Commit 320e8b00 authored by jianghaiming's avatar jianghaiming

update:set

parent 260511f0
...@@ -30,6 +30,14 @@ class GoodsSku extends MysqlBase ...@@ -30,6 +30,14 @@ class GoodsSku extends MysqlBase
return self::get($colums, $where); return self::get($colums, $where);
} }
public static function getRecords($where, $colums = [])
{
if (empty($colums)) {
$colums = '*';
}
return self::select($colums, $where);
}
public static function getRecordMaster($where, $colums = []) public static function getRecordMaster($where, $colums = [])
{ {
if (empty($colums)) { if (empty($colums)) {
......
...@@ -286,7 +286,29 @@ class MarketingService ...@@ -286,7 +286,29 @@ class MarketingService
public static function marketingInfo($params) public static function marketingInfo($params)
{ {
$where['marketing_id'] = !empty($params['marketing_id']) ? $params['marketing_id'] : ''; $where['marketing_id'] = !empty($params['marketing_id']) ? $params['marketing_id'] : '';
$info = Marketing::getRecord($where); $marketing_info = Marketing::getRecord($where);
$goodsSkuList = MarketingGoods::marketingGoodsList($where);
$goodsSkuId = array_column($goodsSkuList , 'goods_sku_id');
$goodsSkuList = GoodsSku::select('*', ['goods_sku_id' => $goodsSkuId]);
$lifeAccountIds = [];
if (!empty($goodsSkuList)) {
$lifeAccountIds = array_column($goodsSkuList, 'life_account_id');
}
$lifeAccountList = CommonService::getlifeAccountList(['life_account_id' => $lifeAccountIds]);
$list = [];
foreach ($goodsSkuList as $key => $value) {
$list[$key]['goods_sku_id'] = $value['goods_sku_id'];
$list[$key]['life_account_id'] = $value['life_account_id'];
$list[$key]['goods_name'] = $value['goods_name'];
$list[$key]['life_account_name'] = !empty($lifeAccountList[$value['life_account_id']]['life_account_name']) ? $lifeAccountList[$value['life_account_id']]['life_account_name'] : '';
}
$info['marketing_info'] = $marketing_info;
$info['goods_list'] = $list;
return $info; return $info;
} }
......
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