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); } }