修复返补BUG
This commit is contained in:
parent
fbc2ea2901
commit
e8ae7e4f9a
@ -66,7 +66,7 @@ class GoodsLogic extends Logic
|
|||||||
}
|
}
|
||||||
|
|
||||||
$goodsDetail = Goods::with(['goods_image', 'goods_item', 'shop'])
|
$goodsDetail = Goods::with(['goods_image', 'goods_item', 'shop'])
|
||||||
->field('id,type,name,image,video,remark,goods_remark,content,purchase_price,issuing_price,wholesale_price,market_price,min_price,max_price,is_show_stock,stock,sales_actual,sales_virtual,clicks,clicks_virtual,shop_id,poster')
|
->field('id,type,name,image,video,remark,goods_remark,content,purchase_price,issuing_price,wholesale_price,market_price,min_price,max_price,is_show_stock,stock,sales_actual,sales_virtual,clicks,clicks_virtual,shop_id,poster,subsidy_id')
|
||||||
->where($onSaleWhere)
|
->where($onSaleWhere)
|
||||||
->where('id', $goodsId)
|
->where('id', $goodsId)
|
||||||
->findOrEmpty();
|
->findOrEmpty();
|
||||||
@ -78,6 +78,11 @@ class GoodsLogic extends Logic
|
|||||||
|
|
||||||
Db::startTrans();
|
Db::startTrans();
|
||||||
try{
|
try{
|
||||||
|
// // 获取返补比例
|
||||||
|
// if ($goodsDetail['subsidy_id'] == 0) {
|
||||||
|
// // 获取
|
||||||
|
// }
|
||||||
|
|
||||||
// 轮播图加域名
|
// 轮播图加域名
|
||||||
foreach($goodsDetail['goods_image'] as &$item) {
|
foreach($goodsDetail['goods_image'] as &$item) {
|
||||||
$item['uri'] = empty($item['uri']) ? '' : UrlServer::getFileUrl($item['uri']);
|
$item['uri'] = empty($item['uri']) ? '' : UrlServer::getFileUrl($item['uri']);
|
||||||
|
|||||||
@ -10,7 +10,7 @@ class GoodsSubsidy extends Models
|
|||||||
{
|
{
|
||||||
$lists = $this->where('is_delete', 0)
|
$lists = $this->where('is_delete', 0)
|
||||||
->order('id desc')
|
->order('id desc')
|
||||||
->field('id, profit, discount, subsidy')
|
->field('id, profit, subsidy')
|
||||||
->paginate([
|
->paginate([
|
||||||
'list_rows'=> $get['limit'],
|
'list_rows'=> $get['limit'],
|
||||||
'page'=> $get['page'],
|
'page'=> $get['page'],
|
||||||
@ -18,7 +18,6 @@ class GoodsSubsidy extends Models
|
|||||||
|
|
||||||
foreach ($lists as &$v) {
|
foreach ($lists as &$v) {
|
||||||
$v['profit'] = self::formatStr($v['profit']);
|
$v['profit'] = self::formatStr($v['profit']);
|
||||||
$v['discount'] = self::formatStr($v['discount']);
|
|
||||||
$v['subsidy'] = self::formatStr($v['subsidy']);
|
$v['subsidy'] = self::formatStr($v['subsidy']);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -27,9 +26,8 @@ class GoodsSubsidy extends Models
|
|||||||
|
|
||||||
public function getSubsidyById($id)
|
public function getSubsidyById($id)
|
||||||
{
|
{
|
||||||
$result = $this->where(['id' => $id, 'is_delete' => 0])->field('id, profit, discount, subsidy')->find();
|
$result = $this->where(['id' => $id, 'is_delete' => 0])->field('id, profit, subsidy')->find();
|
||||||
$result['profit'] = self::formatStr($result['profit']);
|
$result['profit'] = self::formatStr($result['profit']);
|
||||||
$result['discount'] = self::formatStr($result['discount']);
|
|
||||||
$result['subsidy'] = self::formatStr($result['subsidy']);
|
$result['subsidy'] = self::formatStr($result['subsidy']);
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -165,6 +165,7 @@ class Goods extends ShopBase
|
|||||||
'supplier_lists' => json_encode(Supplier::getNameColumn($this->shop_id), JSON_UNESCAPED_UNICODE),
|
'supplier_lists' => json_encode(Supplier::getNameColumn($this->shop_id), JSON_UNESCAPED_UNICODE),
|
||||||
'unit_lists' => json_encode(GoodsUnit::getNameColumn(), JSON_UNESCAPED_UNICODE),
|
'unit_lists' => json_encode(GoodsUnit::getNameColumn(), JSON_UNESCAPED_UNICODE),
|
||||||
'freight_lists' => json_encode(Freight::getNameColumn($this->shop_id), JSON_UNESCAPED_UNICODE),
|
'freight_lists' => json_encode(Freight::getNameColumn($this->shop_id), JSON_UNESCAPED_UNICODE),
|
||||||
|
'subsidy' => json_encode([], JSON_UNESCAPED_UNICODE),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user