Commit ffbc4f99 authored by suntengda's avatar suntengda

Merge branch 'pindan_activity_list_optimize' into develop

parents 6d05dcaf a27d09e3
...@@ -416,15 +416,16 @@ class MarketingService ...@@ -416,15 +416,16 @@ class MarketingService
* @return \Api\PhpUtils\Mysql\MysqlBase|array * @return \Api\PhpUtils\Mysql\MysqlBase|array
* @throws InterfaceException * @throws InterfaceException
*/ */
public static function pindanActiveBasicList($excludeMarketingId='',$limit=2,$needSkuList=true) public static function pindanActiveBasicList($excludeMarketingId='',$limit=1,$needSkuList=true)
{ {
!empty($excludeMarketingId) && $limit += 1;//查询结果需要排除掉传递的活动,所以需要多取一条 $queryLimit = 1;
!empty($excludeMarketingId) && $queryLimit += 1;//查询结果需要排除掉传递的活动,所以需要多取一条
$where["marketing_type"] = Marketing::MARKETING_TYPE_PINDAN; $where["marketing_type"] = Marketing::MARKETING_TYPE_PINDAN;
$where['online_status'] = Marketing::ONLINE_STATUS_QIDONG; $where['online_status'] = Marketing::ONLINE_STATUS_QIDONG;
$where += self::getStartEndTimeFilter(MarketingPindan::ACTIVITY_STATUS_IN_PROGRESS); $where += self::getStartEndTimeFilter(MarketingPindan::ACTIVITY_STATUS_IN_PROGRESS);
$where['life_account_id'] = self::getPublicLifeAccountId(); $where['life_account_id'] = self::getPublicLifeAccountId();
$where['ORDER'] = ['end_time' => 'ASC','marketing_id'=>'ASC']; $where['ORDER'] = ['end_time' => 'ASC','marketing_id'=>'ASC'];
$where['LIMIT'] = [0, $limit]; $where['LIMIT'] = [0, $queryLimit];
$list = Marketing::select(['marketing_id', 'marketing_name','start_time','end_time'], $where); $list = Marketing::select(['marketing_id', 'marketing_name','start_time','end_time'], $where);
if(empty($list)) { if(empty($list)) {
...@@ -449,7 +450,7 @@ class MarketingService ...@@ -449,7 +450,7 @@ class MarketingService
unset($value); unset($value);
} }
$list = array_slice($list,0); $list = array_slice($list,0, $limit);
return $list; return $list;
} }
......
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