|
|
@ -69,7 +69,7 @@ class WithdrawController extends BaseController |
|
|
$store = Store::query()->where(['user_id' => $userId, 'id' => $storeId])->first(); |
|
|
$store = Store::query()->where(['user_id' => $userId, 'id' => $storeId])->first(); |
|
|
if (empty($store)) { |
|
|
if (empty($store)) { |
|
|
$msg = ['user_id' => $userId, 'storeId' => $storeId]; |
|
|
$msg = ['user_id' => $userId, 'storeId' => $storeId]; |
|
|
throw new ErrorCodeException(ErrorCode::STORE_NOT_AVAILABLE,json_encode($msg)); |
|
|
|
|
|
|
|
|
throw new ErrorCodeException(ErrorCode::STORE_NOT_AVAILABLE,'',$msg); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
$data['balance'] = UserBalance::query() |
|
|
$data['balance'] = UserBalance::query() |
|
|
@ -130,7 +130,7 @@ class WithdrawController extends BaseController |
|
|
$store = Store::query()->where(['user_id' => $userId, 'id' => $storeId])->first(); |
|
|
$store = Store::query()->where(['user_id' => $userId, 'id' => $storeId])->first(); |
|
|
if (empty($store)) { |
|
|
if (empty($store)) { |
|
|
$msg = ['user_id' => $userId, 'storeId' => $storeId]; |
|
|
$msg = ['user_id' => $userId, 'storeId' => $storeId]; |
|
|
throw new ErrorCodeException(ErrorCode::STORE_NOT_AVAILABLE, '[稍后重试]' . json_encode($msg)); |
|
|
|
|
|
|
|
|
throw new ErrorCodeException(ErrorCode::STORE_NOT_AVAILABLE, '' , $msg); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 校验余额
|
|
|
// 校验余额
|
|
|
@ -138,7 +138,7 @@ class WithdrawController extends BaseController |
|
|
->where(['source_id' => $store->user_id, 'user_type' => UserType::STORE]) |
|
|
->where(['source_id' => $store->user_id, 'user_type' => UserType::STORE]) |
|
|
->first(); |
|
|
->first(); |
|
|
if ($money > $balance->balance) { |
|
|
if ($money > $balance->balance) { |
|
|
throw new ErrorCodeException(ErrorCode::STORE_WITHDRAW_INSUFFICIENT_BALANCE); |
|
|
|
|
|
|
|
|
throw new ErrorCodeException(ErrorCode::STORE_WITHDRAW_INSUFFICIENT_BALANCE, '', ['message' => '商户提现余额不足','data' => ['money' => $money, 'balance' => $balance->balance]]); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
Db::beginTransaction(); |
|
|
Db::beginTransaction(); |
|
|
|