diff --git a/app/Constants/v3/SsdbKeys.php b/app/Constants/v3/SsdbKeys.php index 3298784..4462edd 100644 --- a/app/Constants/v3/SsdbKeys.php +++ b/app/Constants/v3/SsdbKeys.php @@ -19,7 +19,12 @@ class SsdbKeys extends AbstractConstants * @Message("商品月销") */ const GOODS_MONTH_SALES = 'goods_m_sales_'; - + + /** + * @Message("商户月销") + */ + const STORE_MONTH_SALES = 'store_m_sales_'; + /** * @Message("用户新订单统计") */ diff --git a/app/Controller/v3/GoodsController.php b/app/Controller/v3/GoodsController.php index edd4984..b5468f3 100644 --- a/app/Controller/v3/GoodsController.php +++ b/app/Controller/v3/GoodsController.php @@ -3,6 +3,7 @@ namespace App\Controller\v3; use App\Controller\BaseController; +use App\Service\v3\Interfaces\StoreServiceInterface; use Hyperf\Di\Annotation\Inject; use App\Service\v3\Interfaces\GoodsServiceInterface; class GoodsController extends BaseController @@ -12,10 +13,18 @@ class GoodsController extends BaseController * @var GoodsServiceInterface */ protected $goodsService; + + /** + * @Inject + * @var StoreServiceInterface + */ + protected $storeService; public function detail() { + $params = $this->request->all(); $res['detail'] = $this->goodsService->do(); $res['banner'] = $this->goodsService->getBanner(); + $res['store'] = $this->storeService->detail($params['store_id']); return $this->success($res); } } \ No newline at end of file diff --git a/app/Controller/v3/StoreController.php b/app/Controller/v3/StoreController.php index f53d5be..5ace039 100644 --- a/app/Controller/v3/StoreController.php +++ b/app/Controller/v3/StoreController.php @@ -43,8 +43,8 @@ class StoreController extends BaseController public function index(StoreIndexRequest $request) { $params = $request->validated(); - $data = $this->storeService->detail($params['store_id'], $params['market_id']); - $data['is_collected'] = (bool)$this->collectService->check($params['market_id'], $params['store_id'], $params['user_id']); + $data = $this->storeService->detail($params['store_id']); + $data['is_collected'] = (bool)$this->collectService->check($params['user_id'],$params['store_id']); $data['goods_types'] = $this->categoryService->allForStore($params['store_id']); return $this->success(['store' => $data]); } diff --git a/app/Service/v3/Implementations/StoreService.php b/app/Service/v3/Implementations/StoreService.php index 63ad632..04df5c5 100644 --- a/app/Service/v3/Implementations/StoreService.php +++ b/app/Service/v3/Implementations/StoreService.php @@ -24,14 +24,14 @@ class StoreService implements StoreServiceInterface // TODO: Implement undo() method. } - public function detail($storeId, $marketId) + public function detail($storeId) { return Store::query() ->select([ 'id', 'name', 'logo', 'introduction', 'announcement', 'address', 'tel', 'stall_info', 'is_rest','time1', 'time2', 'time3', 'time4', ]) - ->where(['id' => $storeId, 'market_id' => $marketId]) + ->where('id',$storeId) ->first()->toArray(); } } \ No newline at end of file diff --git a/app/Service/v3/Interfaces/StoreServiceInterface.php b/app/Service/v3/Interfaces/StoreServiceInterface.php index f7d06eb..452c429 100644 --- a/app/Service/v3/Interfaces/StoreServiceInterface.php +++ b/app/Service/v3/Interfaces/StoreServiceInterface.php @@ -7,5 +7,5 @@ interface StoreServiceInterface public function do(); public function check(); public function undo(); - public function detail($storeId, $marketId); + public function detail($storeId); } \ No newline at end of file