提现
Showing
3 changed files
with
17 additions
and
9 deletions
... | @@ -30,6 +30,10 @@ class MusicianWithdrawController extends Controller | ... | @@ -30,6 +30,10 @@ class MusicianWithdrawController extends Controller |
30 | $this->musicianWithdrawService = $musicianWithdrawService; | 30 | $this->musicianWithdrawService = $musicianWithdrawService; |
31 | } | 31 | } |
32 | 32 | ||
33 | /** | ||
34 | * @param MusicianWalletDetailRequest $request | ||
35 | * @return \Illuminate\Http\JsonResponse | ||
36 | */ | ||
33 | public function walletDetail(MusicianWalletDetailRequest $request) | 37 | public function walletDetail(MusicianWalletDetailRequest $request) |
34 | { | 38 | { |
35 | return $this->musicianWithdrawService->walletDetail(); | 39 | return $this->musicianWithdrawService->walletDetail(); | ... | ... |
... | @@ -28,7 +28,7 @@ class MusicianWithdrawStatusRequest extends FormRequest | ... | @@ -28,7 +28,7 @@ class MusicianWithdrawStatusRequest extends FormRequest |
28 | public function rules() | 28 | public function rules() |
29 | { | 29 | { |
30 | return [ | 30 | return [ |
31 | 'serial_no' => ['required', 'bail', 'array', 'filled'], | 31 | 'busi_id' => ['required', 'bail', 'array', 'filled'], |
32 | 'type' => ['required', 'bail', 'in:success,fail,advance'], | 32 | 'type' => ['required', 'bail', 'in:success,fail,advance'], |
33 | ]; | 33 | ]; |
34 | } | 34 | } |
... | @@ -39,7 +39,7 @@ class MusicianWithdrawStatusRequest extends FormRequest | ... | @@ -39,7 +39,7 @@ class MusicianWithdrawStatusRequest extends FormRequest |
39 | public function messages(): array | 39 | public function messages(): array |
40 | { | 40 | { |
41 | return [ | 41 | return [ |
42 | 'serial_no.required'=> '请提供流水号', | 42 | 'busi_id.required'=> '请提供业务流水号', |
43 | 'type.required' => '请提供有效的提现状态变更', | 43 | 'type.required' => '请提供有效的提现状态变更', |
44 | ]; | 44 | ]; |
45 | } | 45 | } | ... | ... |
... | @@ -103,21 +103,25 @@ class MusicianWithdrawService extends Service | ... | @@ -103,21 +103,25 @@ class MusicianWithdrawService extends Service |
103 | $withdraw_status = ''; | 103 | $withdraw_status = ''; |
104 | 104 | ||
105 | $query = StakeholderIncomeByPayer::query()->where(['sync_status'=>1, 'identifier'=>$this->identifier->identifier]) | 105 | $query = StakeholderIncomeByPayer::query()->where(['sync_status'=>1, 'identifier'=>$this->identifier->identifier]) |
106 | ->whereIn('serial_no', $this->request->input('serial_no')); | 106 | ->whereIn('busi_id', $this->request->input('busi_id')); |
107 | 107 | ||
108 | switch ($this->request->input('type')) { | 108 | switch ($this->request->input('type')) { |
109 | case 'fail': | 109 | case 'confirm': //已确认 |
110 | $withdraw_status = 0; | ||
111 | $query = $query->where(['withdraw_status'=>1]); | ||
112 | break; | ||
113 | case 'advance': | ||
114 | $withdraw_status = 1; | 110 | $withdraw_status = 1; |
115 | $query = $query->where(['withdraw_status'=>0]); | 111 | $query = $query->where(['withdraw_status'=>0]); |
116 | break; | 112 | break; |
117 | case 'success': | 113 | case 'fail': //提现失败 -> 待提现 |
114 | $withdraw_status = 1; | ||
115 | $query = $query->where(['withdraw_status'=>2]); | ||
116 | break; | ||
117 | case 'advance': //提现中 | ||
118 | $withdraw_status = 2; | 118 | $withdraw_status = 2; |
119 | $query = $query->where(['withdraw_status'=>1]); | 119 | $query = $query->where(['withdraw_status'=>1]); |
120 | break; | 120 | break; |
121 | case 'success': //提现完成 | ||
122 | $withdraw_status = 3; | ||
123 | $query = $query->where(['withdraw_status'=>2]); | ||
124 | break; | ||
121 | } | 125 | } |
122 | 126 | ||
123 | if ($query->update(['withdraw_status'=>$withdraw_status])) { | 127 | if ($query->update(['withdraw_status'=>$withdraw_status])) { | ... | ... |
-
Please register or sign in to post a comment