12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- <?php
- namespace app\user\controller;
- use app\common\model\UserMessage;
- use library\Controller;
- use think\Db;
- /**
- * 会员反馈
- * Class Integral
- * @package app\user\controller
- */
- class UserFeedback extends Controller
- {
- protected $table ="UserFeedback";
- /**
- * 反馈变更列表
- * @auth true
- * @menu true
- */
- public function index()
- {
- $this->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');
- }
- }
- }
|