|
|
@@ -0,0 +1,143 @@
|
|
|
+<?php
|
|
|
+// +----------------------------------------------------------------------
|
|
|
+// | likeadmin快速开发前后端分离管理后台(PHP版)
|
|
|
+// +----------------------------------------------------------------------
|
|
|
+// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
|
|
+// | 开源版本可自由商用,可去除界面版权logo
|
|
|
+// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
|
|
+// | github下载:https://github.com/likeshop-github/likeadmin
|
|
|
+// | 访问官网:https://www.likeadmin.cn
|
|
|
+// | likeadmin团队 版权所有 拥有最终解释权
|
|
|
+// +----------------------------------------------------------------------
|
|
|
+// | author: likeadminTeam
|
|
|
+// +----------------------------------------------------------------------
|
|
|
+
|
|
|
+namespace app\adminapi\controller\agricultural_machinery;
|
|
|
+
|
|
|
+use app\adminapi\controller\BaseAdminController;
|
|
|
+use app\adminapi\lists\agricultural_machinery\AgriculturalMachineryCategoryLists;
|
|
|
+use app\adminapi\lists\agricultural_machinery\UserServiceLists;
|
|
|
+use app\adminapi\logic\agricultural_machinery\AgriculturalMachineryServiceCategoryLogic;
|
|
|
+use app\adminapi\validate\agricultural_machinery\AgriculturalMachineryServiceCategoryValidate;
|
|
|
+use app\adminapi\validate\agricultural_machinery\UserServiceValidate;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 社会服务管理控制器
|
|
|
+ * Class ArticleCateController
|
|
|
+ * @package app\adminapi\controller\article
|
|
|
+ */
|
|
|
+class UserServiceController extends BaseAdminController
|
|
|
+{
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @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 getUserServiceList()
|
|
|
+ {
|
|
|
+ $params = (new UserServiceValidate())->get()->goCheck('userService');
|
|
|
+ return $this->dataLists(new UserServiceLists());
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @notes 添加资讯分类
|
|
|
+ * @return \think\response\Json
|
|
|
+ * @author heshihu
|
|
|
+ * @date 2022/2/21 17:31
|
|
|
+ */
|
|
|
+ public function add()
|
|
|
+ {
|
|
|
+ $params = (new AgriculturalMachineryServiceCategoryValidate())->post()->goCheck('add');
|
|
|
+ AgriculturalMachineryServiceCategoryLogic::add($params);
|
|
|
+ return $this->success('添加成功', [], 1, 1);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @notes 编辑农耕分类
|
|
|
+ * @return \think\response\Json
|
|
|
+ * @author heshihu
|
|
|
+ * @date 2022/2/21 17:49
|
|
|
+ */
|
|
|
+ public function edit()
|
|
|
+ {
|
|
|
+ $params = (new AgriculturalMachineryServiceCategoryValidate())->post()->goCheck('edit');
|
|
|
+ $result = AgriculturalMachineryServiceCategoryLogic::edit($params);
|
|
|
+ if (true === $result) {
|
|
|
+ return $this->success('编辑成功', [], 1, 1);
|
|
|
+ }
|
|
|
+ return $this->fail(AgriculturalMachineryServiceCategoryLogic::getError());
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @notes 删除农耕分类
|
|
|
+ * @return \think\response\Json
|
|
|
+ * @author heshihu
|
|
|
+ * @date 2022/2/21 17:52
|
|
|
+ */
|
|
|
+ public function delete()
|
|
|
+ {
|
|
|
+ $params = (new AgriculturalMachineryServiceCategoryValidate())->post()->goCheck('delete');
|
|
|
+ AgriculturalMachineryServiceCategoryLogic::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 AgriculturalMachineryServiceCategoryValidate())->goCheck('detail');
|
|
|
+ $result = AgriculturalMachineryServiceCategoryLogic::detail($params);
|
|
|
+ return $this->data($result);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @notes 更改农耕分类状态
|
|
|
+ * @return \think\response\Json
|
|
|
+ * @author heshihu
|
|
|
+ * @date 2022/2/21 10:15
|
|
|
+ */
|
|
|
+ public function updateStatus()
|
|
|
+ {
|
|
|
+ $params = (new AgriculturalMachineryServiceCategoryValidate())->post()->goCheck('status');
|
|
|
+ $result = AgriculturalMachineryServiceCategoryLogic::updateStatus($params);
|
|
|
+ if (true === $result) {
|
|
|
+ return $this->success('修改成功', [], 1, 1);
|
|
|
+ }
|
|
|
+ return $this->fail(AgriculturalMachineryServiceCategoryLogic::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 getValidCate()
|
|
|
+ {
|
|
|
+ $params = (new AgriculturalMachineryServiceCategoryValidate())->get()->goCheck('list');
|
|
|
+ $result = AgriculturalMachineryServiceCategoryLogic::getValidCateData($params);
|
|
|
+ return $this->data($result);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+}
|