transfer
This commit is contained in:
parent
2a00c99daa
commit
f9e9858d11
@ -563,7 +563,7 @@ class EarningController extends Controller
|
||||
throw new Exception("账号不存在");
|
||||
}
|
||||
if ($earning_account->is_banned)
|
||||
throw new \Exception("账号id: {$earning_account->id}异常");
|
||||
throw new Exception("账号id: {$earning_account->id}异常");
|
||||
//查询余额足够?
|
||||
if ($earning_account->balance < $amount)
|
||||
return $this->failure('提现金额不能大于可以提现的总金额!');
|
||||
@ -578,6 +578,7 @@ class EarningController extends Controller
|
||||
$earning_account->frozen_withdraw = $earning_account->frozen_withdraw + $amount;
|
||||
$insert = ['m_id' => $merchant_id, 'm_user_id' => $merchant_user_id, 'way' => $way, 'real_value' => $actual_received, 'value' => $amount, 'trade_no' => $trade_no, 'account' => $account, 'name' => $alipay_real_name, 'status' => 'freezing'];
|
||||
$earning_account->save();
|
||||
Log::info("创建提现记录");
|
||||
$withdraw = MEarningwithdraws::create($insert);
|
||||
if ($amount >= 500) {
|
||||
//通知
|
||||
@ -635,10 +636,10 @@ class EarningController extends Controller
|
||||
$res = json_decode($content, true);
|
||||
if ($res && isset($res['code'])) {
|
||||
if ($res['code']) {
|
||||
throw new \Exception($res['message']);
|
||||
throw new Exception($res['message']);
|
||||
}
|
||||
} else {
|
||||
throw new \Exception("提现失败");
|
||||
throw new Exception("提现失败");
|
||||
}
|
||||
|
||||
// //修改账号状态
|
||||
@ -650,7 +651,7 @@ class EarningController extends Controller
|
||||
}
|
||||
DB::commit();
|
||||
return $this->success('ok', ['status' => 1]);
|
||||
} catch (\Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
DB::rollBack();
|
||||
$this->getError($e);
|
||||
return $this->failure('服务器休息,请稍后再试');
|
||||
|
||||
Loading…
Reference in New Issue
Block a user