title = '反馈列表'; $where= []; if($this->request->request('name')) $where[]= ['m.name','like','%'.$this->request->request('phone').'%']; $where[]= ['f.is_deleted','=',0]; $query = $this->_query($this->table); $query->alias('f') ->field('f.* ,m.headimg,m.name') ->join('store_member m',' m.id = f.user_id ','LEFT'); if(!empty($where)) $query->where($where); $query ->order('f.id desc')->page(); } /**反馈列表处理 * @param array $data * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\ModelNotFoundException * @throws \think\exception\DbException */ protected function _index_page_filter(array &$data) { } /** * 删除反馈日志 * @auth true * @menu true */ public function del() { $this->_save($this->table, ['is_deleted' => 1]); } /** * 回复 * @auth true * @menu true */ public function edit() { $this->title = '回复'; $this->_form($this->table,'form'); } protected function _form_filter(&$data) { $info = \app\common\model\UserFeedback::where('id',$data['id'])->find()->toArray(); UserMessage:: sendUserMessage($info['user_id'],'feedback',1,0,0,$data['id']); if($data['status'] == 1 && $info['status'] != $data['status']) $data['dispose_time'] = date('Y-m-d H:i:s'); if($data['status'] == 2 && $info['status'] != $data['status']) { if(!$data['dispose_time']) $data['dispose_time'] = date('Y-m-d H:i:s'); $data['over_time'] = date('Y-m-d H:i:s'); } } }