feat(order): 添加会员价格功能
- 在预订单逻辑中增加会员价格计算 - 在仓库产品逻辑中添加会员价格字段
This commit is contained in:
parent
14555837fe
commit
95262ab5af
@ -370,6 +370,9 @@ class BeforehandOrderLogic extends BaseLogic
|
||||
if ($count > 0) {
|
||||
throw new BusinessException('订单中有数量为0的商品,请先处理');
|
||||
}
|
||||
if($order['uid']>0){
|
||||
$user_ship=User::where('id', $order['uid'])->value('user_ship')??0;
|
||||
}
|
||||
Db::startTrans();
|
||||
try {
|
||||
$arr = [
|
||||
@ -386,6 +389,7 @@ class BeforehandOrderLogic extends BaseLogic
|
||||
$arr['delivery_time'] = strtotime($delivery_time);
|
||||
$res = WarehouseOrder::create($arr);
|
||||
foreach ($info as $key => $arr) {
|
||||
$price=StoreProductGroupPrice::where('product_id',$arr['product_id'])->where('group_id',$user_ship)->value('price')??0;
|
||||
$data = [
|
||||
'warehouse_id' => $warehouse_id,
|
||||
'product_id' => $arr['product_id'],
|
||||
@ -398,6 +402,7 @@ class BeforehandOrderLogic extends BaseLogic
|
||||
'admin_id' => $admin_id,
|
||||
'total_price' => $arr['total_price'],
|
||||
'price' => $arr['price'],
|
||||
'vip_price' => $price==0?$arr['price']:$price,
|
||||
'purchase' => $arr['purchase'],
|
||||
'oid' => $res['id'],
|
||||
'code' => $res['code'],
|
||||
|
@ -167,6 +167,7 @@ class WarehouseProductLogic extends BaseLogic
|
||||
'after_nums' => $after_nums,
|
||||
'price' => $params['price'] ?? 0,
|
||||
'purchase' => $params['purchase'] ?? 0,
|
||||
'vip_price' => $params['vip_price'] ?? 0,
|
||||
'total_price' => $params['total_price'] ?? 0,
|
||||
'admin_id' => $params['admin_id'],
|
||||
'code' => $params['code'] ?? '',
|
||||
|
Loading…
x
Reference in New Issue
Block a user