| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166 |
- <?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\logic\agricultural_machinery\UserServiceLogic;
- use app\adminapi\validate\agricultural_machinery\SupplyDemandValidate;
- use app\adminapi\logic\agricultural_machinery\SupplyDemandLogic;
- use app\adminapi\lists\agricultural_machinery\SupplyDemandLists;
- use app\adminapi\lists\agricultural_machinery\SupplyDemandCateLists;
- use app\adminapi\validate\agricultural_machinery\SupplyDemandCateValidate;
- /**
- * 供需管理控制器
- * Class ArticleCateController
- * @package app\adminapi\controller\article
- */
- class SupplyDemandController 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 getSupplyDemandList()
- {
- $params = (new SupplyDemandValidate())->get()->goCheck('supplyDemand');
- return $this->dataLists(new SupplyDemandLists());
- }
- /**
- * @notes 删除服务商
- * @return \think\response\Json
- * @author heshihu
- * @date 2022/2/21 17:52
- */
- public function delete()
- {
- $params = (new SupplyDemandValidate())->post()->goCheck('delete');
- SupplyDemandLogic::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 SupplyDemandValidate())->goCheck('detail');
- $result = SupplyDemandLogic::detail($params);
- return $this->data($result);
- }
- /**
- * @notes 更改供需状态
- * @return \think\response\Json
- * @author heshihu
- * @date 2022/2/21 10:15
- */
- public function updateStatus()
- {
- $params = (new SupplyDemandValidate())->post()->goCheck('status');
- $result = SupplyDemandLogic::updateStatus($params);
- if (true === $result) {
- return $this->success('审核成功', [], 1, 1);
- }
- return $this->fail(SupplyDemandLogic::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);
- }
- /*
- * 供需分类列表
- * */
- public function supplyDemandCateLists(){
- $params = (new SupplyDemandCateValidate())->get()->goCheck('SupplyDemandCate');
- return $this->dataLists(new SupplyDemandCateLists());
- }
- /**
- * @notes 添加资讯分类
- * @return \think\response\Json
- * @author heshihu
- * @date 2022/2/21 17:31
- */
- public function addCate()
- {
- $params = (new SupplyDemandCateValidate())->post()->goCheck('add');
- SupplyDemandLogic::addCate($params);
- return $this->success('添加成功', [], 1, 1);
- }
- public function cateDetail()
- {
- $params = (new SupplyDemandCateValidate())->goCheck('detail');
- $result = SupplyDemandLogic::detailCate($params);
- return $this->data($result);
- }
- public function editCate()
- {
- $params = (new SupplyDemandCateValidate())->post()->goCheck('edit');
- $result = SupplyDemandLogic::editCate($params);
- if (true === $result) {
- return $this->success('编辑成功', [], 1, 1);
- }
- return $this->fail(SupplyDemandLogic::getError());
- }
- /**
- * @notes 更改供需状态
- * @return \think\response\Json
- * @author heshihu
- * @date 2022/2/21 10:15
- */
- public function updateCateStatus()
- {
- $params = (new SupplyDemandCateValidate())->post()->goCheck('status');
- $result = SupplyDemandLogic::updateCateStatus($params);
- if (true === $result) {
- return $this->success('修改成功', [], 1, 1);
- }
- return $this->fail(SupplyDemandLogic::getError());
- }
- public function deleteCate()
- {
- $params = (new SupplyDemandCateValidate())->post()->goCheck('delete');
- SupplyDemandLogic::deleteCate($params);
- return $this->success('删除成功', [], 1, 1);
- }
- }
|