|
|
@@ -207,6 +207,16 @@ class UserExtractRepository extends BaseRepository
|
|
|
if ($data['extract_type'] == self::EXTRACT_TYPE_YUE) {
|
|
|
$this->switchStatus($res->extract_id, ['status' => 1]);
|
|
|
}
|
|
|
+// bill表创建提现记录
|
|
|
+ $userBillRepository = app()->make(UserBillRepository::class);
|
|
|
+ $userBillRepository->decBill($data['uid'], 'brokerage', 'extract', [
|
|
|
+ 'link_id' => $res->extract_id,
|
|
|
+ 'status' => 1,
|
|
|
+ 'title' => '奖金提现',
|
|
|
+ 'number' => $data['extract_price'],
|
|
|
+ 'mark' => '用户提现奖金'.$data['extract_price'].'元',
|
|
|
+ 'balance' => $brokerage_price
|
|
|
+ ]);
|
|
|
return $res;
|
|
|
});
|
|
|
|
|
|
@@ -367,11 +377,23 @@ class UserExtractRepository extends BaseRepository
|
|
|
if ($brokerage_price) {
|
|
|
$user->brokerage_price = $brokerage_price;
|
|
|
$user->save();
|
|
|
+ if ($data['status']==-1){
|
|
|
+ // bill表创建提现退还记录
|
|
|
+ $userBillRepository = app()->make(UserBillRepository::class);
|
|
|
+ $userBillRepository->incBill($data['uid'], 'brokerage', 'extract', [
|
|
|
+ 'link_id' => $id,
|
|
|
+ 'status' => 0,
|
|
|
+ 'title' => '提现退还',
|
|
|
+ 'number' => $data['extract_price'],
|
|
|
+ 'mark' => '用户提现审核失败,退回奖金'.$data['extract_price'].'元',
|
|
|
+ 'balance' => $brokerage_price
|
|
|
+ ]);
|
|
|
+ }
|
|
|
}
|
|
|
$data['check_time'] = time();
|
|
|
// 更新提取记录状态
|
|
|
$userExtract = $this->dao->update($id, $data);
|
|
|
- if ($out) $userBillRepository->decBill($user->uid, 'brokerage', $out['type'], $out['data']);
|
|
|
+// if ($out) $userBillRepository->decBill($user->uid, 'brokerage', $out['type'], $out['data']);
|
|
|
// 触发状态切换后的事件
|
|
|
event('user.extractStatus', compact('id', 'userExtract'));
|
|
|
});
|