feat: 移除支付类型为3时的兑换券逻辑
This commit is contained in:
parent
01ae705dbf
commit
83fce9e9dd
@ -96,14 +96,6 @@ class PayNotifyLogic extends BaseLogic
|
||||
$capitalFlowDao->userExpense('user_order_balance_pay', 'order', $order['id'], $order['pay_price'], '', 0, $order['store_id']);
|
||||
self::dealProductLog($order);
|
||||
if ($order['shipping_type'] == 3) {
|
||||
//预留收银台余额支付得兑换券逻辑
|
||||
if ($order->uid >0) {
|
||||
$level = User::where('id',$order->uid)->value('user_ship');
|
||||
$discount = self::getDiscount($level);
|
||||
$total_vip = bcmul($order['pay_price'], $discount, 2);
|
||||
self::addNewUserSing($order,8,$total_vip,1,1);
|
||||
User::where('id', $order->uid)->inc('integral', $total_vip)->update();
|
||||
}
|
||||
// self::descStock($order['id']);
|
||||
}
|
||||
self::afterPay($order);
|
||||
@ -154,18 +146,18 @@ class PayNotifyLogic extends BaseLogic
|
||||
$user->integral = bcsub($user['integral'], $order['pay_price'], 2);
|
||||
$user->save();
|
||||
//入礼品券表扣款记录
|
||||
$sing[] = [
|
||||
$sing = [
|
||||
'uid' => $order['uid'],
|
||||
'order_id' => $order['order_id'],
|
||||
// 'title' => '订单扣除兑换券',
|
||||
'title' => 5,
|
||||
'financial_pm' => 0,
|
||||
'status' => 1,
|
||||
'store_id' => $order['store_id'],
|
||||
'number' => $order['pay_price'],
|
||||
'type' => 1,
|
||||
'user_ship' => $user['user_ship'],
|
||||
];
|
||||
(new UserSign())->saveAll($sing);
|
||||
UserSign::create($sing);
|
||||
|
||||
if ($extra && $extra['store_id']) {
|
||||
$params = [
|
||||
@ -744,24 +736,6 @@ class PayNotifyLogic extends BaseLogic
|
||||
|
||||
if ($order['shipping_type'] == 3) {
|
||||
self::descStock($order['id']);
|
||||
//直接加到礼品券中
|
||||
$user_sing = new UserSign();
|
||||
$level = User::where('id',$order['uid'])->value('user_ship');
|
||||
$discount = self::getDiscount($level);
|
||||
$total_vip = bcmul($order['pay_price'], $discount, 2);
|
||||
$sing[] = [
|
||||
'uid' => $order['uid'],
|
||||
'order_id' => $order['order_id'],
|
||||
'title' => 8,
|
||||
'financial_pm' => 1,
|
||||
'store_id' => $order['store_id'],
|
||||
'type' => 1,
|
||||
'status' => 1,
|
||||
'number' => $total_vip,
|
||||
'back_num' => $total_vip,
|
||||
];
|
||||
$user_sing->saveAll($sing);
|
||||
User::where('id', $order->uid)->inc('integral', $total_vip)->update();
|
||||
}
|
||||
|
||||
|
||||
@ -800,15 +774,6 @@ class PayNotifyLogic extends BaseLogic
|
||||
self::dealProductLog($order);
|
||||
if ($order['shipping_type'] == 3) {
|
||||
self::descStock($order['id']);
|
||||
//直接加兑换券到对应得账户
|
||||
if ($order->uid >0) {
|
||||
$level = User::where('id',$order['uid'])->value('user_ship');
|
||||
$discount = self::getDiscount($level);
|
||||
$total_vip = bcmul($order['pay_price'], $discount, 2);
|
||||
self::addNewUserSing($order,8,$total_vip,1,1);
|
||||
User::where('id', $order->uid)->inc('integral', $total_vip)->update();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// if ($order->pay_type == 9) {
|
||||
|
@ -38,7 +38,7 @@ class UserSignLogic extends BaseLogic
|
||||
*/
|
||||
public static function OrderWrite($order)
|
||||
{
|
||||
$total_vip = bcmul($order['price'], 0.1, 2);
|
||||
$total_vip = bcmul($order['pay_price'], 0.1, 2);
|
||||
|
||||
//非收银台订单冻结里礼品卷
|
||||
if ($order['source'] == 0) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user