544782275@qq.com 3 years ago
parent
commit
448a44da72

+ 11 - 0
application/store/controller/Consult.php

@@ -62,6 +62,7 @@ class Consult extends Controller
         }
         $query = $query->alias('a')->join('store_member b', 'a.user_id=b.id');
         $query->where('a.type = 1');
+        $query->where('a.is_deleted = 0');
         $engineer_id = session('user.engineer_id');
         if($engineer_id > 0){
             $query->where('a.from_user_id = '.$engineer_id.' or a.is_answer = 0');
@@ -136,4 +137,14 @@ class Consult extends Controller
         }
 
     }
+    /**
+     * 删除咨询
+     * @auth true
+     * @throws \think\Exception
+     * @throws \think\exception\PDOException
+     */
+    public function remove()
+    {
+        $this->_save($this->table, ['is_deleted' => '1']);
+    }
 }

+ 1 - 0
application/store/view/consult/index.html

@@ -41,6 +41,7 @@
                 {if $engineer_id > 0 && $vo.is_answer == 0}
                 <a data-title="立即解答" class="layui-btn layui-btn-sm layui-bg-orange" data-modal='{:url("answer")}?id={$vo.id}'>立即解答</a>
                 {/if}
+                <a class="layui-btn layui-btn-sm layui-btn-danger" data-confirm="确定要删除该咨询吗?" data-action="{:url('remove')}" data-value="id#{$vo.id}">删 除</a>
             </td>
         </tr>
         {/foreach}