| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- <?php
- namespace app\api\controller;
- use app\api\logic\IssueWorkLogic;
- use app\api\validate\IssueWorkValidate;
- use app\common\model\dict\DictData;
- /**
- *
- * Class IssueWorkController
- * @package app\api\controller
- */
- class IssueWorkController extends BaseApiController
- {
- /**
- * @notes 投诉列表
- * @return \think\response\Json
- * @author likeadmin
- * @date 2024/07/10 15:06
- */
- public function lists()
- {
- $params['user_id'] = $this->userId;
- $result = IssueWorkLogic::lists($params);
- return $this->data($result);
- }
- public function is_complaint()
- {
- $params = (new IssueWorkValidate())->get()->goCheck('isCheck', [
- 'user_id' => $this->userId,
- 'user_info' => $this->userInfo
- ]);
- $result = IssueWorkLogic::checkComplaint($params);
- if (false === $result) {
- return $this->fail(IssueWorkLogic::getError());
- }
- return $this->success('success', $result, 1, 1);
- }
- /**
- * 获取投诉分类
- * @return \think\response\Json
- * @throws \think\db\exception\DataNotFoundException
- * @throws \think\db\exception\DbException
- * @throws \think\db\exception\ModelNotFoundException
- */
- public function getIssueWorkType()
- {
- $list = DictData::where(['type_value'=>'complaint_type','status'=>1])->field('value,name')->select()->toArray();
- return $this->data($list);
- }
- /**
- * 新增投诉
- * @return \think\response\Json
- */
- public function complaint()
- {
- $params = (new IssueWorkValidate())->post()->goCheck('add', [
- 'user_id' => $this->userId,
- 'user_info' => $this->userInfo
- ]);
- $result = IssueWorkLogic::add($params);
- if (false === $result) {
- return $this->fail(IssueWorkLogic::getError());
- }
- return $this->success('投诉成功', ['id'=>$result], 1, 1);
- }
- public function complaintInfo()
- {
- $params = (new IssueWorkValidate())->goCheck('detail', [
- 'user_id' => $this->userId,
- ]);
- $result = IssueWorkLogic::detail($params);
- return $this->data($result);
- }
- /**
- * 完结投诉
- * @return \think\response\Json
- */
- public function complaintComplete()
- {
- $params = (new IssueWorkValidate())->post()->goCheck('detail', [
- 'user_id' => $this->userId,
- 'user_info' => $this->userInfo
- ]);
- $result = IssueWorkLogic::complaintComplete($params);
- if (false === $result) {
- return $this->fail(IssueWorkLogic::getError());
- }
- return $this->success('提交成功', [], 1, 1);
- }
- }
|