好物优选添加上商品返比文字
This commit is contained in:
parent
7370d693ed
commit
7f867587da
@ -641,7 +641,7 @@ class GoodsLogic extends Logic
|
||||
$where[] = ['purchase_price|issuing_price|wholesale_price', '>', 0];
|
||||
}
|
||||
}
|
||||
$list = Goods::field('id,name,image,market_price,min_price,wholesale_price,purchase_price,issuing_price,sales_actual,column_ids,sort_weight,sales_virtual,(sales_actual + sales_virtual) as sales_total')
|
||||
$list = Goods::field('id,name,image,market_price,min_price,wholesale_price,purchase_price,issuing_price,sales_actual,column_ids,sort_weight,sales_virtual,(sales_actual + sales_virtual) as sales_total, subsidy_id')
|
||||
->where($onSaleWhere)
|
||||
->where($where)
|
||||
->whereFindInSet('column_ids', $columnId)
|
||||
@ -689,6 +689,13 @@ class GoodsLogic extends Logic
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($list as $k => $v) {
|
||||
// 获取返补比例, subsidy_id为0的就传递一个ID为4的固定ID
|
||||
$list[$k]['subsidy'] = (new GoodsSubsidy())->getSubsidyById($v['subsidy_id'] > 0 ? $v['subsidy_id'] : 4);
|
||||
$list[$k]['subsidy_txt'] = '最高返' . $list[$k]['subsidy']['subsidy'];
|
||||
}
|
||||
|
||||
$count = Goods::where($onSaleWhere)
|
||||
->where($where)
|
||||
->whereFindInSet('column_ids', $columnId)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user