diff --git a/app/Controller/v3/StoreController.php b/app/Controller/v3/StoreController.php index b5c29c1..1d4f463 100644 --- a/app/Controller/v3/StoreController.php +++ b/app/Controller/v3/StoreController.php @@ -95,9 +95,7 @@ class StoreController extends BaseController { $storeId = $this->request->input('store_id'); $typeId = $this->request->input('type_id',''); - $page = $this->request->input('page',1); - $pagesize = $this->request->input('pagesize',10); - $goods = $this->goodsService->getByType($storeId,$typeId,$page,$pagesize); + $goods = $this->goodsService->getByType($storeId,$typeId); return $this->success($goods); } diff --git a/app/Service/v3/Implementations/GoodsService.php b/app/Service/v3/Implementations/GoodsService.php index e50e04f..2350987 100644 --- a/app/Service/v3/Implementations/GoodsService.php +++ b/app/Service/v3/Implementations/GoodsService.php @@ -67,17 +67,13 @@ class GoodsService implements GoodsServiceInterface public function detail($goodsId) { - $res = Goods::query()->with('store')->where('id',$goodsId)->first(); + $res = Goods::query()->with('store')->where('id',$goodsId)->select('*','name as goods_name')->first(); return $res; } - public function getByType($storeId,$typeId, $page=1, $pagesize=10) + public function getByType($storeId,$typeId) { - $builder = Goods::query()->where(['store_id' => $storeId,'category_id' => $typeId]); - - $paginate = $builder->orderByDesc('on_sale')->orderByDesc('created_at')->paginate($pagesize); - $goods = $paginate->toArray(); - return ['has_more_pages' => $paginate->hasMorePages(), 'goods' => $goods['data']]; + return Goods::query()->where(['store_id' => $storeId,'category_id' => $typeId])->orderByDesc('on_sale')->orderByDesc('created_at')->get()->toArray(); } public function update($params) diff --git a/app/Service/v3/Implementations/UserCenterBlockService.php b/app/Service/v3/Implementations/UserCenterBlockService.php index 9b66e32..eea8dcd 100644 --- a/app/Service/v3/Implementations/UserCenterBlockService.php +++ b/app/Service/v3/Implementations/UserCenterBlockService.php @@ -51,7 +51,7 @@ class UserCenterBlockService implements UserCenterBlockServiceInterface [ 'name' => '商品管理', 'icon' => $img_host . 'user_icons/service2.png', 'type' => 'webview', - 'path' => '/pages/webview/webview?data=%27%7b%22webview_url%22%3a%22http%3a%2f%2flocalhost%3a8080%2f%23%2fpages%2fgoodsManagement%2fgoodsManagement%3fmarket_id%3d1%26user_id%3d694%26store_id%3d5%22%7d%27', + 'path' => 'http://localhost:8080/#/pages/goodsManagement/goodsManagement?market_id=1&user_id=694&store_id=5', 'command'=>'sp_login' ] ] @@ -79,7 +79,7 @@ class UserCenterBlockService implements UserCenterBlockServiceInterface [ 'name' => '商品管理', 'icon' => $img_host . 'user_icons/service2.png', 'type' => 'webview', - 'path' => '/pages/webview/webview?data=%27%7b%22webview_url%22%3a%22http%3a%2f%2flocalhost%3a8080%2f%23%2fpages%2fgoodsManagement%2fgoodsManagement%3fmarket_id%3d1%26user_id%3d694%26store_id%3d5%22%7d%27', + 'path' => 'http://localhost:8080/#/pages/goodsManagement/goodsManagement?market_id=1&user_id=694&store_id=5', 'command'=>'sp_login' ] ] diff --git a/app/Service/v3/Interfaces/GoodsServiceInterface.php b/app/Service/v3/Interfaces/GoodsServiceInterface.php index 32c0251..2ff7952 100644 --- a/app/Service/v3/Interfaces/GoodsServiceInterface.php +++ b/app/Service/v3/Interfaces/GoodsServiceInterface.php @@ -10,6 +10,6 @@ interface GoodsServiceInterface public function check(Goods $goods,$num = 1); public function undo(); public function getBanner($goodsId); - public function getByType($storeId,$typeId, $page=1, $pagesize=10); + public function getByType($storeId,$typeId); public function update($params); } \ No newline at end of file