Commit a84b2737 authored by luhongguang's avatar luhongguang

Merge branch 'develop' of https://git.yidian-inc.com:8021/bp/goods into develop

parents 9c6ffc3b 1136e25b
...@@ -11,6 +11,7 @@ use Api\PhpUtils\Validate\Validate; ...@@ -11,6 +11,7 @@ use Api\PhpUtils\Validate\Validate;
use Api\PhpServices\Idgen\Idgen; use Api\PhpServices\Idgen\Idgen;
use Api\PhpServices\Ksy\Ksyun; use Api\PhpServices\Ksy\Ksyun;
use App\Exception\custom\MarketingException; use App\Exception\custom\MarketingException;
use App\Services\common\CommonService;
use Api\PhpServices\Sensitive\Sensitive; use Api\PhpServices\Sensitive\Sensitive;
class MarketingGoodsService class MarketingGoodsService
{ {
...@@ -47,12 +48,24 @@ class MarketingGoodsService ...@@ -47,12 +48,24 @@ class MarketingGoodsService
$subShopList = SubShop::getRecordMaster(['shop_id' => $shopId]); $subShopList = SubShop::getRecordMaster(['shop_id' => $shopId]);
$subShopList = array_column($subShopList,null,'shop_id'); $subShopList = array_column($subShopList,null,'shop_id');
$marketingList = array_column($marketingList,null,'marketing_id');
$lifeAccountId = array_column($goodsSkuList, 'life_account_id');
$lifeAccountList = CommonService::getlifeAccountList(['life_account_id' => $lifeAccountId]);
$list = []; $list = [];
$i = 0; $i = 0;
foreach ($data as $key => $value) { foreach ($data as $key => $value) {
$list[$i] = $value; $list[$i] = $value;
$list[$i]['life_account_id'] = !empty($goodsSkuList[$value['goods_sku_id']]['life_account_id']) ? $goodsSkuList[$value['goods_sku_id']]['life_account_id'] : ''; $list[$i]['life_account_id'] = !empty($goodsSkuList[$value['goods_sku_id']]['life_account_id']) ? $goodsSkuList[$value['goods_sku_id']]['life_account_id'] : '';
$life_account_id = !empty($list[$i]['life_account_id']) ? $list[$i]['life_account_id'] : '';
$list[$i]['life_account_name'] = !empty($lifeAccountList[$life_account_id]['life_account_name']) ? $lifeAccountList[$life_account_id]['life_account_name'] : '';
$list[$i]['life_account_icon'] = !empty($lifeAccountList[$life_account_id]['life_account_icon']) ? $lifeAccountList[$life_account_id]['life_account_icon'] : '';
$list[$i]['shop_id'] = !empty($goodsSkuList[$value['goods_sku_id']]['shop_id']) ? $goodsSkuList[$value['goods_sku_id']]['shop_id'] : ''; $list[$i]['shop_id'] = !empty($goodsSkuList[$value['goods_sku_id']]['shop_id']) ? $goodsSkuList[$value['goods_sku_id']]['shop_id'] : '';
$list[$i]['goods_name'] = !empty($goodsSkuList[$value['goods_sku_id']]['goods_name']) ? $goodsSkuList[$value['goods_sku_id']]['goods_name'] : ''; $list[$i]['goods_name'] = !empty($goodsSkuList[$value['goods_sku_id']]['goods_name']) ? $goodsSkuList[$value['goods_sku_id']]['goods_name'] : '';
$list[$i]['goods_desc'] = !empty($goodsSkuList[$value['goods_sku_id']]['desc']) ? $goodsSkuList[$value['goods_sku_id']]['desc'] : ''; $list[$i]['goods_desc'] = !empty($goodsSkuList[$value['goods_sku_id']]['desc']) ? $goodsSkuList[$value['goods_sku_id']]['desc'] : '';
...@@ -65,6 +78,20 @@ class MarketingGoodsService ...@@ -65,6 +78,20 @@ class MarketingGoodsService
$shopId = !empty($list[$i]['shop_id']) ? $list[$i]['shop_id'] : ''; $shopId = !empty($list[$i]['shop_id']) ? $list[$i]['shop_id'] : '';
$list[$i]['shop_name'] = !empty($subShopList[$shopId]['shop_name']) ? $subShopList[$shopId]['shop_name'] : ''; $list[$i]['shop_name'] = !empty($subShopList[$shopId]['shop_name']) ? $subShopList[$shopId]['shop_name'] : '';
$commissionMode = !empty($marketingList[$value['marketing_id']]['commission_mode']) ? $marketingList[$value['marketing_id']]['commission_mode'] : '';
$firstCommission = !empty($marketingList[$value['marketing_id']]['first_commission_value']) ? $marketingList[$value['marketing_id']]['first_commission_value'] : 0;
//比例
if (!empty($commissionMode) && $commissionMode == 1) {
$price = !empty($list[$i]['price']) ? $list[$i]['price'] : 0;
$list[$i]['share_price'] = $firstCommission*$price/100;
}
//固定
if (!empty($commissionMode) && $commissionMode == 2) {
$list[$i]['share_price'] = $firstCommission;
}
$i++; $i++;
} }
......
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