This commit is contained in:
luofei 2024-01-20 18:12:11 +08:00
commit e90af16576
2 changed files with 16 additions and 11 deletions

View File

@ -489,16 +489,19 @@ class StoreOrderCreateRepository extends StoreOrderRepository
if ($source == 103) {
$ConsumptionWhere = [
'uid' => $uid,
'start_time' => date('Y-m-d H:i:s'),
'status' => 0,
'is_fail' => 0
];
$platformConsumption = Db::name('store_consumption_user')->where($ConsumptionWhere)->limit(100)->order('create_time', 'desc')
->field('uid,coupon_title,coupon_price')
->select();
if(count($platformConsumption)>1){
$consumption=$platformConsumption[0];
}
->field('uid,coupon_title,coupon_price,start_time,end_time')
->select()->each(function($item){
$item['describe']='仅限平台指定商家商品可使用';
return $item;
});
// if(count($platformConsumption)>1){
// $consumption=$platformConsumption[0];
// }
}
// }
@ -558,9 +561,9 @@ class StoreOrderCreateRepository extends StoreOrderRepository
$pay_price = $org_price;
}
if($consumption){
$pay_price = bcsub($pay_price, $consumption['coupon_price'], 2);
}
// if($consumption){
// $pay_price = bcsub($pay_price, $consumption['coupon_price'], 2);
// }
$giveIntegralFlag = $sysIntegralConfig['integral_status'] && $sysIntegralConfig['integral_order_rate'] > 0;
$total_give_integral = 0;
@ -628,7 +631,8 @@ class StoreOrderCreateRepository extends StoreOrderRepository
'address',
'openIntegral',
'useIntegral',
'key'
'key',
'platformConsumption'
) + ['allow_address' => !$allow_no_address, 'order_delivery_status' => $orderDeliveryStatus];
}

View File

@ -373,7 +373,7 @@ class StoreOrderRepository extends BaseRepository
//计算镇级供应链云仓实际获得金额
if ($_order_rate > 0) {
$commission_rate = bcdiv(3, 100, 2);
$commission_rate = bcdiv(12, 100, 2);
$_payPrice = bcmul($_order_rate, $commission_rate, 2);
} else {
$_payPrice = 0;
@ -409,6 +409,7 @@ class StoreOrderRepository extends BaseRepository
if (!$presell) {
if ($order['commission_rate'] > 0 || $order->source == 103) {
//支出手续费
$finance[] = [
'order_id' => $order->order_id,
'order_sn' => $order->order_sn,