修改礼品券核销逻辑
This commit is contained in:
parent
b12e9b2ef6
commit
df67ee7699
@ -458,6 +458,11 @@ class OrderLogic extends BaseLogic
|
||||
$money=$financeFlow->where(['order_id'=>$order['id'],'financial_pm'=>1,'financial_type'=>2])->value('number');
|
||||
$financeFlowLogic->updateStatusStore($order['id'],$order['store_id'],$money,$deposit);
|
||||
|
||||
$check = Db::name('user_sign_log')->where('order_id',$order['order_id'])->find();
|
||||
if($check){
|
||||
User::where('id',$order['uid'])->inc('purchase_funds',$check['number'])->update();
|
||||
}
|
||||
|
||||
Db::commit();
|
||||
return true;
|
||||
} catch (\Exception $e) {
|
||||
|
@ -256,11 +256,12 @@ class PayNotifyLogic extends BaseLogic
|
||||
];
|
||||
|
||||
if($one['back_num'] >= $backPurchase){
|
||||
$wait = bcsub($one['back_num'],$backPurchase,2)??0;
|
||||
|
||||
$data['number'] =$backPurchase;
|
||||
$data['number'] =$wait;
|
||||
Db::name('user_sign_log')->insert($data);
|
||||
//总的减去采购款百分之十剩余的
|
||||
$wait = bcsub($one['back_num'],$backPurchase,2)??0;
|
||||
|
||||
|
||||
if(empty($wait)){
|
||||
UserSign::where('id',$one['id'])->update(
|
||||
@ -273,13 +274,13 @@ class PayNotifyLogic extends BaseLogic
|
||||
//add
|
||||
UserSign::where('id',$one['id'])->update(
|
||||
[
|
||||
'back_num'=>$wait
|
||||
'back_num'=>$backPurchase
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
//并且加到对应的用户的采购款中
|
||||
User::where('id',$order['uid'])->inc('purchase_funds',$wait)->update();
|
||||
// User::where('id',$order['uid'])->inc('purchase_funds',$wait)->update();
|
||||
}
|
||||
else{
|
||||
//对比采购款支付的多少 多了就拿冻结金额即可
|
||||
@ -293,7 +294,7 @@ class PayNotifyLogic extends BaseLogic
|
||||
]
|
||||
);
|
||||
//并且加到对应的用户的采购款中
|
||||
User::where('id',$order['uid'])->inc('purchase_funds',$one['number'])->update();
|
||||
// User::where('id',$order['uid'])->inc('purchase_funds',$wait)->update();
|
||||
}
|
||||
|
||||
}
|
||||
@ -322,8 +323,18 @@ class PayNotifyLogic extends BaseLogic
|
||||
];
|
||||
$data['number'] =$check;
|
||||
Db::name('user_sign')->insert($data);
|
||||
|
||||
$data = [
|
||||
'uid' => $order['uid'],
|
||||
'order_id' => $order['order_id'],
|
||||
'title' => '充值获得冻结兑换券',
|
||||
'financial_pm' => 1,
|
||||
'type' => 1,
|
||||
];
|
||||
$data['number'] =$backPurchase;
|
||||
Db::name('user_sign_log')->insert($data);
|
||||
}
|
||||
User::where('id',$order['uid'])->inc('purchase_funds',$backPurchase)->update();//add
|
||||
// User::where('id',$order['uid'])->inc('purchase_funds',$backPurchase)->update();//add
|
||||
|
||||
}else{
|
||||
//log
|
||||
@ -336,7 +347,7 @@ class PayNotifyLogic extends BaseLogic
|
||||
];
|
||||
$data['number'] =$check;
|
||||
Db::name('user_sign_log')->insert($data);
|
||||
User::where('id',$order['uid'])->inc('purchase_funds',$check)->update();//add
|
||||
// User::where('id',$order['uid'])->inc('purchase_funds',$check)->update();//add
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user