修改语句
This commit is contained in:
parent
891865e98f
commit
b12e9b2ef6
@ -256,10 +256,12 @@ class PayNotifyLogic extends BaseLogic
|
||||
];
|
||||
|
||||
if($one['back_num'] >= $backPurchase){
|
||||
|
||||
$data['number'] =$backPurchase;
|
||||
Db::name('user_sign_log')->insert($data);
|
||||
//总的减去采购款百分之十剩余的
|
||||
$wait = bcsub($one['back_num'],$backPurchase,2);
|
||||
$wait = bcsub($one['back_num'],$backPurchase,2)??0;
|
||||
|
||||
if(empty($wait)){
|
||||
UserSign::where('id',$one['id'])->update(
|
||||
[
|
||||
@ -269,12 +271,13 @@ class PayNotifyLogic extends BaseLogic
|
||||
);
|
||||
}else{
|
||||
//add
|
||||
UserSign::where('id',$one['id'])->update([
|
||||
UserSign::where('id',$one['id'])->update(
|
||||
[
|
||||
'back_num'=>$wait
|
||||
]
|
||||
]);
|
||||
);
|
||||
}
|
||||
|
||||
//并且加到对应的用户的采购款中
|
||||
User::where('id',$order['uid'])->inc('purchase_funds',$wait)->update();
|
||||
}
|
||||
@ -293,7 +296,8 @@ class PayNotifyLogic extends BaseLogic
|
||||
User::where('id',$order['uid'])->inc('purchase_funds',$one['number'])->update();
|
||||
}
|
||||
|
||||
}else{
|
||||
}
|
||||
else{
|
||||
//大于0的时候
|
||||
//先处理金额大的再处理剩余的
|
||||
/**** 把所有的金额改为正的再加一条后再加***/
|
||||
|
Loading…
x
Reference in New Issue
Block a user