增加采购款 余额支付冻结礼品券逻辑
This commit is contained in:
parent
dba7e7ec8c
commit
9d54b4dea1
@ -115,8 +115,8 @@ class UserLogic extends BaseLogic
|
||||
$data['openid'] = UserAuth::where(['user_id'=>$uid,'terminal'=>1])->value('openid');
|
||||
$number=UserSign::where('uid',$uid)->where('status',0)->sum('number');
|
||||
$data['integral']=bcadd($data['integral'],$number,2);
|
||||
$number = UserSign::where('id',$uid)->where('status',0)->sum('number');
|
||||
$GetNumber = UserSign::where('id',$uid)->where('status',1)->sum('number');
|
||||
$number = UserSign::where('uid',$uid)->where('status',0)->sum('number');
|
||||
$GetNumber = UserSign::where('uid',$uid)->where('status',1)->sum('number');
|
||||
$data['number'] =$number;
|
||||
$data['GetNumber'] =$GetNumber;
|
||||
}else{
|
||||
|
@ -88,6 +88,7 @@ class PayNotifyLogic extends BaseLogic
|
||||
$order['pay_price'] = $oldUser;
|
||||
}
|
||||
}
|
||||
self::addUserSing($order);
|
||||
$capitalFlowDao = new CapitalFlowLogic($user);
|
||||
$capitalFlowDao->userExpense('user_order_balance_pay', 'order', $order['id'], $order['pay_price'], '', 0, $order['store_id']);
|
||||
self::dealProductLog($order);
|
||||
@ -184,7 +185,7 @@ class PayNotifyLogic extends BaseLogic
|
||||
// if ($user['user_ship'] == 1) {
|
||||
// self::dealVipAmount($order, PayEnum::PURCHASE_FUNDS);
|
||||
// }
|
||||
|
||||
self::addUserSing($order);
|
||||
if ($extra && $extra['store_id']) {
|
||||
$params = [
|
||||
'verify_code' => $order['verify_code'],
|
||||
@ -383,6 +384,23 @@ class PayNotifyLogic extends BaseLogic
|
||||
return true;
|
||||
}
|
||||
|
||||
//入冻结礼品券
|
||||
public static function addUserSing($order)
|
||||
{
|
||||
$user_sing = new UserSign();
|
||||
if ($order['uid'] > 0 && $order['total_price'] > 500) {
|
||||
$user_number = bcmul($order['pay_price'], '0.10', 2);
|
||||
$sing = [
|
||||
'uid' => $order['uid'],
|
||||
'order_id' => $order['order_id'],
|
||||
'title' => '购买商品获得兑换券',
|
||||
'store_id' => $order['store_id'],
|
||||
'number' => $user_number,
|
||||
];
|
||||
$user_sing->save($sing);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
@ -75,7 +75,7 @@ class SmsService
|
||||
return false;
|
||||
}
|
||||
}catch(NoGatewayAvailableException $e){
|
||||
d($e);
|
||||
|
||||
throw new BusinessException($e->getExceptions());
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user