123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- <?php
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- namespace app\shopapi\controller;
-
- use app\common\basics\ShopApi;
- use app\common\server\JsonServer;
- use app\shopapi\logic\GoodsLogic;
-
-
- class Goods extends ShopApi {
-
-
- public function lists()
- {
- $params = $this->request->param();
- $params['page_no'] = $this->page_no;
- $params['page_size'] = $this->page_size;
- $params['shop_id'] = $this->shop_id;
-
- $result = (new GoodsLogic())->lists($params);
- return JsonServer::success('', $result);
- }
-
-
-
- public function operation()
- {
- if ($this->request->isAjax() || !$this->request->isPost()) {
- return JsonServer::error("请求方式错误");
- }
-
- $result = (new GoodsLogic())->operation($this->shop_id, $this->request->post());
- if($result){
- return JsonServer::success('操作成功');
- }
- return JsonServer::error(GoodsLogic::getError());
- }
-
-
-
- public function detail()
- {
- $result = (new GoodsLogic())->detail($this->request->get('id'));
- return JsonServer::success('', $result);
- }
-
-
-
- public function edit()
- {
- if ($this->request->isAjax() || !$this->request->isPost()) {
- return JsonServer::error("请求方式错误");
- }
-
- $result = (new GoodsLogic())->edit($this->request->post());
- if($result){
- return JsonServer::success('编辑成功');
- }
- return JsonServer::error(GoodsLogic::getError());
- }
- }
|