|
|
|
@ -24,31 +24,76 @@ class PurchaseLimitService implements PurchaseLimitServiceInterface |
|
|
|
*/ |
|
|
|
protected $paramsTokenService; |
|
|
|
|
|
|
|
/** |
|
|
|
* @Inject |
|
|
|
* @var AdServiceInterface |
|
|
|
*/ |
|
|
|
protected $adService; |
|
|
|
|
|
|
|
public function getStoreIdByMarketId($params) |
|
|
|
{ |
|
|
|
$market_id = $params['market_id']; |
|
|
|
$res = []; |
|
|
|
//获取ssdb上的首页banner logo 列表
|
|
|
|
$logo_list = $this->paramsTokenService->analyze('banner_logo_list'); |
|
|
|
if (false === $logo_list) { |
|
|
|
return $res; |
|
|
|
} |
|
|
|
//获取ssdb上的首页banner 市场 列表
|
|
|
|
$market_list = $this->paramsTokenService->analyze('banner_market_list'); |
|
|
|
if (false === $market_list) { |
|
|
|
return $res; |
|
|
|
} |
|
|
|
//根据前端指定的指获取店铺id 字符串 并拆分成数组
|
|
|
|
$store_list = $market_list['market_id_'.$market_id]; |
|
|
|
$store_list = explode(',',$store_list); |
|
|
|
if(isset($market_list['market_id_'.$market_id])) { |
|
|
|
$store_list = $market_list['market_id_' . $market_id]; |
|
|
|
$store_list = explode(',', $store_list); |
|
|
|
//遍历店铺
|
|
|
|
foreach ($store_list as $store_id){ |
|
|
|
foreach ($store_list as $store_id) { |
|
|
|
$res[] = [ |
|
|
|
'id' => 7, |
|
|
|
'id' => $store_id, |
|
|
|
'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, |
|
|
|
'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 getBannerByMarketId($params) |
|
|
|
{ |
|
|
|
$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 字符串 并拆分成数组
|
|
|
|
if(isset($market_list['market_id_'.$market_id])) { |
|
|
|
$store_list = $market_list['market_id_' . $market_id]; |
|
|
|
$store_list = explode(',', $store_list); |
|
|
|
//遍历店铺
|
|
|
|
foreach ($store_list as $store_id) { |
|
|
|
$banners[] = [ |
|
|
|
'id' => $store_id, |
|
|
|
'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, |
|
|
|
]; |
|
|
|
} |
|
|
|
}else{ |
|
|
|
$banners = $this->adService->banners(); |
|
|
|
} |
|
|
|
return $banners; |
|
|
|
} |
|
|
|
|
|
|
|
public function ssdbPurchaseRecord($data,$user_id,$global_order_id) |
|
|
|
{ |
|
|
|
foreach ($data as $k => $v){ |
|
|
|
|