商品列表添加上商品返比文字
This commit is contained in:
parent
7f867587da
commit
77304504c9
@ -935,10 +935,14 @@ class GoodsLogic extends Logic
|
||||
->field('hl.id as hl_id, g.id as id, g.name, g.image, g.issuing_price, g.market_price, g.min_price, g.purchase_price, g.wholesale_price')
|
||||
->select()
|
||||
->toArray();
|
||||
foreach ($hot_list as &$v) {
|
||||
foreach ($hot_list as $k => &$v) {
|
||||
if (isset($v['image'])) {
|
||||
$v['image'] = UrlServer::getFileUrl($v['image']);
|
||||
}
|
||||
|
||||
// 获取返补比例, subsidy_id为0的就传递一个ID为4的固定ID
|
||||
$hot_list[$k]['subsidy'] = (new GoodsSubsidy())->getSubsidyById($v['subsidy_id'] > 0 ? $v['subsidy_id'] : 4);
|
||||
$hot_list[$k]['subsidy_txt'] = '最高返' . $hot_list[$k]['subsidy']['subsidy'];
|
||||
}
|
||||
}
|
||||
|
||||
@ -974,10 +978,14 @@ class GoodsLogic extends Logic
|
||||
->group('og.goods_id')
|
||||
->count();
|
||||
|
||||
foreach ($order_goods as &$v) {
|
||||
foreach ($order_goods as $k => &$v) {
|
||||
if (isset($v['image'])) {
|
||||
$v['image'] = UrlServer::getFileUrl($v['image']);
|
||||
}
|
||||
|
||||
// 获取返补比例, subsidy_id为0的就传递一个ID为4的固定ID
|
||||
$order_goods[$k]['subsidy'] = (new GoodsSubsidy())->getSubsidyById($v['subsidy_id'] > 0 ? $v['subsidy_id'] : 4);
|
||||
$order_goods[$k]['subsidy_txt'] = '最高返' . $order_goods[$k]['subsidy']['subsidy'];
|
||||
}
|
||||
|
||||
$more = is_more($count, $page, $size); //是否有下一页
|
||||
@ -1021,7 +1029,7 @@ class GoodsLogic extends Logic
|
||||
->where($onSaleWhere)
|
||||
->where($shopWhere)
|
||||
->where('delete_time', 0)
|
||||
->field('ng.id as ng_id, g.id as id, g.name, g.image, g.issuing_price, g.market_price, g.min_price, g.purchase_price, g.wholesale_price')
|
||||
->field('ng.id as ng_id, g.id as id, g.name, g.image, g.issuing_price, g.market_price, g.min_price, g.purchase_price, g.wholesale_price, g.subsidy_id')
|
||||
->limit(4)
|
||||
->select()
|
||||
->toArray();
|
||||
@ -1039,10 +1047,14 @@ class GoodsLogic extends Logic
|
||||
}
|
||||
|
||||
$result = array_merge($list, $goods);
|
||||
foreach ($result as &$v) {
|
||||
foreach ($result as $k => &$v) {
|
||||
if (isset($v['image'])) {
|
||||
$v['image'] = UrlServer::getFileUrl($v['image']);
|
||||
}
|
||||
|
||||
// 获取返补比例, subsidy_id为0的就传递一个ID为4的固定ID
|
||||
$result[$k]['subsidy'] = (new GoodsSubsidy())->getSubsidyById($v['subsidy_id'] > 0 ? $v['subsidy_id'] : 4);
|
||||
$result[$k]['subsidy_txt'] = '最高返' . $result[$k]['subsidy']['subsidy'];
|
||||
}
|
||||
return $result;
|
||||
} else if ($type == 'all') {
|
||||
@ -1070,10 +1082,14 @@ class GoodsLogic extends Logic
|
||||
|
||||
$result = array_merge($list, $goods);
|
||||
|
||||
foreach ($result as &$v) {
|
||||
foreach ($result as $k => &$v) {
|
||||
if (isset($v['image'])) {
|
||||
$v['image'] = UrlServer::getFileUrl($v['image']);
|
||||
}
|
||||
|
||||
// 获取返补比例, subsidy_id为0的就传递一个ID为4的固定ID
|
||||
$result[$k]['subsidy'] = (new GoodsSubsidy())->getSubsidyById($v['subsidy_id'] > 0 ? $v['subsidy_id'] : 4);
|
||||
$result[$k]['subsidy_txt'] = '最高返' . $result[$k]['subsidy']['subsidy'];
|
||||
}
|
||||
|
||||
$more = is_more($count, $page, $size); //是否有下一页
|
||||
|
||||
Loading…
Reference in New Issue
Block a user