get()->goCheck('userService'); return $this->dataLists(new UserServiceLists()); } /** * @notes 添加服务商信息 * @return \think\response\Json * @author heshihu * @date 2022/2/21 17:31 */ public function addUserService() { if($this->request->isPost()) { $params = (new UserServiceValidate())->post()->goCheck('add'); // $userId = $this->userId; // $params['user_id'] = $userId; switch ($params['type']){ case 1 : $type_name = '农机手'; break; case 2 : $type_name = '烘干服务'; break ; case 3 : $type_name = '飞防服务'; break; default : $type_name = ''; break; } $result = UserServiceLogic::add($params,$type_name); if (1 === $result['code']) { return $this->success($type_name.'入驻信息添加成功', $result['data'], 1, 1); }else{ return $this->fail(UserServiceLogic::getError()); } }else{ return $this->fail('请求方式错误'); } // // // $params = (new UserServiceValidate())->post()->goCheck('add'); // UserServiceLogic::add($params); // return $this->success('添加成功', [], 1, 1); } /** * @notes 删除服务商 * @return \think\response\Json * @author heshihu * @date 2022/2/21 17:52 */ public function delete() { $params = (new UserServiceValidate())->post()->goCheck('delete'); UserServiceLogic::delete($params); return $this->success('删除成功', [], 1, 1); } /** * @notes 服务详情 * @return \think\response\Json * @author heshihu * @date 2022/2/21 17:54 */ public function detail() { $params = (new UserServiceValidate())->goCheck('detail'); $result = UserServiceLogic::detail($params); return $this->data($result); } /** * @notes 更改服务商状态 * @return \think\response\Json * @author heshihu * @date 2022/2/21 10:15 */ public function updateStatus() { $params = (new UserServiceValidate())->post()->goCheck('status'); $result = UserServiceLogic::updateStatus($params); if (true === $result) { return $this->success('修改成功', [], 1, 1); } return $this->fail(UserServiceLogic::getError()); } /** * @notes 服务商审核 * @return \think\response\Json * @author heshihu * @date 2022/2/21 10:15 */ public function auditUserService() { $params = (new UserServiceValidate())->post()->goCheck('audit'); $params['user_id'] = $this->adminId; $result = UserServiceLogic::auditUserService($params); if (true === $result) { return $this->success('操作成功', [], 1, 1); } return $this->fail(UserServiceLogic::getError()); } /** * @notes 获取会员列表 * @return \think\response\Json * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException * @author 段誉 * @date 2022/10/13 10:54 */ public function getUserList() { $result = UserServiceLogic::getValidUserData(); return $this->data($result); } /** * @notes 获取W服务信息 * @return \think\response\Json * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException * @author 段誉 * @date 2022/10/13 10:54 */ public function getServiceContent() { $result = UserServiceLogic::getServiceContent(); return $this->data($result); } public function editServiceContent() { $params = (new UserServiceValidate())->post()->goCheck('editContent'); $result = UserServiceLogic::saveServiceContent($params); if (true === $result) { return $this->success('保存成功', [], 1, 1); } return $this->fail(UserServiceLogic::getError()); } public function getUserServiceData(){ $result = UserServiceLogic::getServiceList(); return $this->success('查询成功', $result, 1, 1); } public function getServiceDisclaimer() { $result = UserServiceLogic::getServiceDisclaimer(); return $this->data($result); } public function editServiceDisclaimer() { $params = (new UserServiceValidate())->post()->goCheck('disclaimer'); $result = UserServiceLogic::saveServiceDisclaimer($params); if (true === $result) { return $this->success('保存成功', [], 1, 1); } return $this->fail(UserServiceLogic::getError()); } public function getMechanicalCateList() { return $this->dataLists(new MechanicalCateLists()); } /** * @notes 添加机械分类 * @return \think\response\Json * @author heshihu * @date 2022/2/21 17:31 */ public function addMechanicalCate() { $params = (new UserServiceValidate())->post()->goCheck('addMechanicalCate'); UserServiceLogic::addMechanicalCate($params); return $this->success('添加成功', [], 1, 1); } }