Commit 65a6a5e0 authored by luhongguang's avatar luhongguang

Merge branch 'jiang_fix_0816' into test

parents 2bb3fb8f 67e02da0
......@@ -30,6 +30,7 @@ class MarketingService
*/
public static function getPublicLifeAccountId()
{
/**
$env = \Yaf\Application::app()->environ();
if (in_array($env, ['dev'])) {
$lifeAccountId = "13076446786650120";
......@@ -39,6 +40,8 @@ class MarketingService
// $lifeAccountId = self::ONLINE_LIFE_ACCOUNT_ID;
$lifeAccountId = self::ONLINE_LIFE_ACCOUNT_ID_TEST;//测试用
}
*/
$lifeAccountId = config('lifeaccount','life_account_id');
return $lifeAccountId;
}
......@@ -172,6 +175,10 @@ class MarketingService
$where['marketing_id'] = $params['marketing_id'];
}
$where['life_account_id'] = self::getPublicLifeAccountId();
if (!empty($params['online_status'])) {
if (is_array($params['online_status'])) {
foreach ($params['online_status'] as $key => $valu) {
......@@ -256,6 +263,8 @@ class MarketingService
$where["start_time[>]"] = $beforeSevenDay;
}
$where['life_account_id'] = self::getPublicLifeAccountId();
$where['ORDER'] = ["update_time" => "DESC"];
$where['LIMIT'] = [$page, $limit];
$list = Marketing::select(["marketing_id", "marketing_name", "start_time", "end_time",
......@@ -410,6 +419,8 @@ class MarketingService
throw new MarketingException(['cus'=>14]);
}
$lifeAccountId = config('lifeaccount','life_account_id');
$tmpMarketingId = [];
$tmpGoodsSkuId = [];
$goodsData = [
......@@ -473,6 +484,7 @@ class MarketingService
'update_time' => date("Y-m-d H:i:s"),
'create_time' => date("Y-m-d H:i:s"),
'commission_mode' => $commissionMode,
'life_account_id' => $lifeAccountId,
];
$marketingId = Marketing::insertRecord($colums);
if (empty($marketingId)) {
......@@ -539,8 +551,8 @@ class MarketingService
$type = Marketing::MARKETING_TYPE_PINDAN;
$goodsSkuId = !empty($params['goods_sku_id']) ? explode(",", $params['goods_sku_id']) : [];
$takePlaceIds = !empty($params['take_place_ids']) ? explode(",", $params['take_place_ids']) : [];
$publicLifeAccountId = self::getPublicLifeAccountId();
//$publicLifeAccountId = self::getPublicLifeAccountId();
$lifeAccountId = config('lifeaccount','life_account_id');
if (empty($marketingName)) {
throw new MarketingException(['cus' => 0]);
}
......@@ -561,7 +573,7 @@ class MarketingService
$marketing = Marketing::getRecord(["marketing_name" => $marketingName], ["marketing_id"]);
if (!empty($marketing)) {
$marketingPindan = MarketingPindan::getRecord(["marketing_id" => $marketing["marketing_id"]]);
if (!empty($marketingPindan) && $publicLifeAccountId == $marketingPindan["publish_life_account_id"]) {
if (!empty($marketingPindan) && $lifeAccountId == $marketingPindan["publish_life_account_id"]) {
throw new MarketingException(['cus' => 18]);
}
}
......@@ -594,6 +606,7 @@ class MarketingService
'update_user_email' => $createUserEmail,
'update_time' => date("Y-m-d H:i:s"),
'create_time' => date("Y-m-d H:i:s"),
'life_account_id' => $lifeAccountId
];
$marketingId = Marketing::insertRecord($marketingParams);
if (empty($marketingId)) {
......@@ -603,7 +616,7 @@ class MarketingService
$pindanParams = [
"marketing_id" => $marketingId,
"publish_life_account_id" => $publicLifeAccountId,
"publish_life_account_id" => $lifeAccountId,
"pindan_pic" => $pindanPic,
"pindan_desc" => $pindanDesc,
"min_price" => $minPrice,
......
......@@ -145,7 +145,9 @@ class TakePlaceService
];
}
$where['ORDER'] = ['marketing_take_place_id' => 'DESC'];
$where['LIMIT'] = [$offset, $limit];
// 如果分页后排序,排序就会有问题,自提点数量有限也不用分页处理。
// $where['LIMIT'] = [$offset, $limit];
$relations = MarketingTakePlace::select('*', $where);
if(empty($relations)) {
......
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