dataLists(new KefuLists()); } /** * @notes 添加客服 * @return \think\response\Json * @author 段誉 * @date 2022/3/8 18:53 */ public function add() { $params = (new KefuValidate())->post()->goCheck('add'); (new KefuLogic())->add($params); return $this->success('添加成功',[],1,1); } /** * @notes 编辑客服 * @return \think\response\Json * @author 段誉 * @date 2022/3/8 18:53 */ public function edit() { $params = (new KefuValidate())->post()->goCheck('edit'); KefuLogic::edit($params); return $this->success('编辑成功', [], 1, 1); } /** * @notes 删除客服 * @return \think\response\Json * @author 段誉 * @date 2022/3/8 18:53 */ public function del() { $params = (new KefuValidate())->post()->goCheck('del'); KefuLogic::del($params['id']); return $this->success('删除成功', [], 1, 1); } /** * @notes 获取客服详情 * @return \think\response\Json * @author 段誉 * @date 2022/3/8 18:55 */ public function detail() { $params = (new KefuValidate())->goCheck('detail'); $result = KefuLogic::detail($params['id']); return $this->success('获取成功', $result); } /** * @notes 设置状态 * @return \think\response\Json * @author 段誉 * @date 2022/3/8 18:53 */ public function status() { $params = (new KefuValidate())->post()->goCheck('status'); KefuLogic::setStatus($params); return $this->success('设置成功', [], 1, 1); } /** * @notes 登录工作台 * @return \think\response\Json|void * @author 段誉 * @date 2022/3/18 16:31 */ public function login() { $params = (new LoginValidate())->post()->goCheck(); $res = KefuLogic::login($params['id']); if (false === $res) { return $this->fail(KefuLogic::getError() ?: '系统错误'); } return $this->success('', ['url' => $res]); } }