Commit 935043b5 authored by luhongguang's avatar luhongguang

update:写死的自营生活号

parent 27b2575e
......@@ -19,7 +19,22 @@ use Daemon\Goods;
class MarketingService
{
const PUBLIC_LIFE_ACCOUNT_ID = "13076446786650120";
/**
* 写死的自营生活号
* @return string
*/
public static function getPublicLifeAccountId()
{
$env = \Yaf\Application::app()->environ();
if (in_array($env, ['dev'])) {
$lifeAccountId = "13076446786650120";
} elseif (in_array($env, ['test'])) {
$lifeAccountId = "15559498695737346";
}else {
$lifeAccountId = "";
}
return $lifeAccountId;
}
/**
* op 后台获取活动需要参加的商品
......@@ -470,7 +485,7 @@ class MarketingService
$endTime = !empty($params['end_time']) ? $params['end_time'] : '';
$type = Marketing::MARKETING_TYPE_PINDAN;
$goodsSkuId = !empty($params['goods_sku_id']) ? explode(",", $params['goods_sku_id']) : [];
$publicLifeAccountId = self::PUBLIC_LIFE_ACCOUNT_ID;
$publicLifeAccountId = self::getPublicLifeAccountId();
if (empty($marketingName)) {
throw new MarketingException(['cus' => 0]);
......
......@@ -10,7 +10,6 @@ use App\Exception\custom\MarketingException;
class TakePlaceService
{
const SELF_LIFE_ACCOUNT_ID = 123123;
/**
* 获取自提点列表(op 后台)
*
......@@ -54,7 +53,8 @@ class TakePlaceService
}
}
$data['life_account_id'] = $params['life_account_id'] ?? self::SELF_LIFE_ACCOUNT_ID;
$lifeAccountId = MarketingService::getPublicLifeAccountId();
$data['life_account_id'] = $params['life_account_id'] ?? $lifeAccountId;
$data['take_place_name'] = $params['name'];
$data['longitude'] = $params['longitude'];
$data['latitude'] = $params['latitude'];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment