diff --git a/app/Service/PurchaseLimitService.php b/app/Service/PurchaseLimitService.php index 5fe5f02..3c7c2bd 100644 --- a/app/Service/PurchaseLimitService.php +++ b/app/Service/PurchaseLimitService.php @@ -18,27 +18,35 @@ use App\Constants\SsdbKeysPrefix; class PurchaseLimitService implements PurchaseLimitServiceInterface { + /** + * @Inject + * @var ParamsTokenServiceInterface + */ + protected $paramsTokenService; + public function getStoreIdByMarketId($params) { - // $res[] = [ - // 'id' => 7, - // 'item' => 1, - // 'item_text' => 'page', - // 'logo' => 'http://lanzutest.lanzulive.com/attachment/images/2/2020/08/PY55Y3Mz17yJo17rv1Z7vImX1V5159.jpg', - // 'redirect_url' => '/zh_cjdianc/pages/takeout/takeoutindex?storeid=123', - // 'src' => '/zh_cjdianc/pages/takeout/takeoutindex?storeid=123', - // 'src2' => '/zh_cjdianc/pages/takeout/takeoutindex?storeid=123', - // ]; - // $res[] = [ - // 'id' => 8, - // 'item' => 1, - // 'item_text' => 'page', - // 'logo' => 'http://lanzutest.lanzulive.com/attachment/images/2/2020/08/PY55Y3Mz17yJo17rv1Z7vImX1V5159.jpg', - // 'redirect_url' => '/zh_cjdianc/pages/takeout/takeoutindex?storeid=109', - // 'src' => '/zh_cjdianc/pages/takeout/takeoutindex?storeid=109', - // 'src2' => '/zh_cjdianc/pages/takeout/takeoutindex?storeid=109', - // ]; - return ''; + $market_id = $params['market_id']; + //获取ssdb上的首页banner logo 列表 + $logo_list = $this->paramsTokenService->analyze('banner_logo_list'); + //获取ssdb上的首页banner 市场 列表 + $market_list = $this->paramsTokenService->analyze('banner_market_list'); + //根据前端指定的指获取店铺id 字符串 并拆分成数组 + $store_list = $market_list['market_id_'.$market_id]; + $store_list = explode(',',$store_list); + //遍历店铺 + foreach ($store_list as $store_id){ + $res[] = [ + 'id' => 7, + 'item' => 1, + 'item_text' => 'page', + 'logo' => $logo_list['store_id_'.$store_id], + 'redirect_url' => '/zh_cjdianc/pages/takeout/takeoutindex?storeid='.$store_id, + 'src' => '/zh_cjdianc/pages/takeout/takeoutindex?storeid='.$store_id, + 'src2' => '/zh_cjdianc/pages/takeout/takeoutindex?storeid='.$store_id, + ]; + } + return $res; } public function ssdbPurchaseRecord($data,$user_id,$global_order_id)