|
@@ -138,13 +138,17 @@ class Redpacket extends Api{
|
|
|
if (!$result){
|
|
|
return json_send(['code'=>'error','msg'=>'提现失败','data'=>['error'=>'获取余额信息失败']]);
|
|
|
}
|
|
|
- $balance = 0;
|
|
|
- }else{
|
|
|
- $balance = $amountInfo['amount'];
|
|
|
}
|
|
|
//加入用户余额
|
|
|
$result = $CustomAmount::query()->where(['custom_uid'=>$uid])->increment('amount',$info['money']);
|
|
|
- if (!$result) return json_send(['code'=>'error','msg'=>'领取红包失败']);
|
|
|
+ if (!$result) return json_send(['code'=>'error','msg'=>'领取红包失败']);
|
|
|
+ //重新获取用户信息
|
|
|
+ $amountInfo = $CustomAmount::query()->where(['custom_uid'=>$uid])->first();
|
|
|
+ if (!$amountInfo){
|
|
|
+ DB::rollBack();
|
|
|
+ return json_send(['code'=>'error','msg'=>'获取用户余额信息失败']);
|
|
|
+ }
|
|
|
+ $balance = $amountInfo['amount'];
|
|
|
//写入余额记录
|
|
|
$recordInfo = [
|
|
|
'transfer_bill_no' => $info['id'],
|