本地生活商品列表添加获取返补比例
This commit is contained in:
parent
a2d6864795
commit
a33d0e3b52
@ -57,7 +57,7 @@ class LocalStoreGoodsLogic extends Logic
|
||||
$m_where[] = ['delete_time', '=', 0];
|
||||
|
||||
$list = LocalStoreGoods::with(['pic', 'item'])
|
||||
->field('id, lstore_id, title, price, is_multiple_spec')
|
||||
->field('id, lstore_id, title, price, is_multiple_spec, subsidy_id')
|
||||
->where($where)
|
||||
->where($m_where)
|
||||
->order($order)
|
||||
@ -65,6 +65,12 @@ class LocalStoreGoodsLogic extends Logic
|
||||
->select()
|
||||
->toArray();
|
||||
|
||||
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'];
|
||||
}
|
||||
|
||||
if ($get['lstore_id'] == Config::get('localstore.dlh_lstore_id')) {
|
||||
foreach ($list as $k => &$v) {
|
||||
// $list[$k]['original_price'] = $v['price'];
|
||||
|
||||
Loading…
Reference in New Issue
Block a user