12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- <?php
- namespace app\api\controller;
- use app\common\model\UserFeedback;
- use app\common\model\UserMessage;
- /**
- * @title 反馈
- * @controller Feedback
- * @group base
- */
- class Feedback extends Base
- {
- public function initialize()
- {
- parent::initialize();
- parent::checkLogin();
- }
- /**
- * @title 用户反馈
- * @desc 用户反馈
- * @author qc
- * @url /api/Feedback/leaveFeedback
- * @method POST
- * @header name:Authorization require:1 desc:Token
- * @param name:content type:string require:1 default:-- desc:反馈内容
- * @param name:desc type:string require:1 default:-- desc:反馈说明
- */
- public function leaveFeedback()
- {
- $insert_data = [
- 'user_id'=>$this->user_id,
- 'content'=>input('content'),
- 'desc'=>input('desc'),
- 'create_at'=>date('Y-m-d H:i:s')
- ];
- $res = UserFeedback::create($insert_data);
- $this->success('反馈成功',$res->id);
- }
- /**
- * @title 用户反馈列表
- * @desc 用户反馈列表
- * @author qc
- * @url /api/Feedback/getFeedbackList
- * @method GET
- * @header name:Authorization require:1 desc:Token
- * @param name:page type:int default:0 desc:页数
- * @param name:page_num type:int default:20 desc:每页数
- * @return name:content type:string default:-- desc:反馈内容
- * @return name:desc type:string default:-- desc:反馈说明
- * @return name:status type:int default:-- desc:处理进度【0待处理,1处理中,2已完成】
- * @return name:create_at type:string default:-- desc:反馈时间
- * @return name:dispose_time type:string default:-- desc:开始处理时间
- * @return name:over_time type:string default:-- desc:处理完成时间
- * @return name:reply type:string default:-- desc:后台回复
- */
- public function getFeedbackList()
- {
- $list = UserFeedback::where(['user_id'=>$this->user_id])
- ->limit($this->off_set,$this->page_num)
- ->select()->toArray();
- $this->success('ok',['list'=>$list]);
- }
- /**
- * @title 用户反馈详情
- * @desc 用户反馈详情
- * @author qc
- * @url /api/Feedback/getFeedbackInfo
- * @method GET
- * @header name:Authorization require:1 desc:Token
- * @param name:id type:int default:0 desc:反馈记录id
- * @return name:content type:string default:-- desc:反馈内容
- * @return name:desc type:string default:-- desc:反馈说明
- * @return name:status type:int default:-- desc:处理进度【0待处理,1处理中,2已完成】
- * @return name:create_at type:string default:-- desc:反馈时间
- * @return name:dispose_time type:string default:-- desc:开始处理时间
- * @return name:over_time type:string default:-- desc:处理完成时间
- * @return name:reply type:string default:-- desc:后台回复
- */
- public function getFeedbackInfo()
- {
- $id = input('get.id');
- $detail = UserFeedback::where(['user_id'=>$this->user_id,'id'=>$id])->find()->toArray();
- $this->success('ok',['detail'=>$detail]);
- }
- }
|