123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- <?php
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- namespace app\api\controller;
-
- use app\common\basics\Api;
- use app\common\server\JsonServer;
- use think\facade\Validate;
- use app\api\logic\ShopFollowLogic;
-
-
- class ShopFollow extends Api
- {
-
-
- public function changeStatus()
- {
- if($this->request->isPost()) {
- $shopId = $this->request->post('shop_id', '', 'trim');
- $validate = Validate::rule('shop_id', 'require|integer|gt:0');
- if(!$validate->check(['shop_id'=>$shopId])) {
- return JsonServer::error($validate->getError());
- }
- $data= ShopFollowLogic::changeStatus($shopId, $this->user_id);
- if($data['result']) {
- return JsonServer::success($data['msg']);
- }
- return JsonServer::error('操作失败');
- }else{
- return JsonServer::error('请求方式错误');
- }
- }
-
-
-
- public function lists()
- {
- $get = $this->request->get();
- $get['user_id'] = $this->user_id;
- $get['page_no'] = $this->page_no;
- $get['page_size'] = $this->page_size;
-
- $data = ShopFollowLogic::lists($get);
- return JsonServer::success('', $data);
- }
- }
|