*
Showing
1 changed file
with
7 additions
and
4 deletions
| ... | @@ -48,22 +48,25 @@ class MusicianWithdrawService extends Service | ... | @@ -48,22 +48,25 @@ class MusicianWithdrawService extends Service |
| 48 | { | 48 | { |
| 49 | $withdraw_status = ''; | 49 | $withdraw_status = ''; |
| 50 | 50 | ||
| 51 | $query = StakeholderIncomeByPayer::query()->where(['sync_status'=>1, 'identifier'=>$this->identifier->identifier]) | ||
| 52 | ->whereIn('serial_no', $this->request->input('serial_no')); | ||
| 53 | |||
| 51 | switch ($this->request->input('type')) { | 54 | switch ($this->request->input('type')) { |
| 52 | case 'fail': | 55 | case 'fail': |
| 53 | $withdraw_status = 0; | 56 | $withdraw_status = 0; |
| 57 | $query = $query->where(['withdraw_status'=>1]); | ||
| 54 | break; | 58 | break; |
| 55 | case 'advance': | 59 | case 'advance': |
| 56 | $withdraw_status = 1; | 60 | $withdraw_status = 1; |
| 61 | $query = $query->where(['withdraw_status'=>0]); | ||
| 57 | break; | 62 | break; |
| 58 | case 'success': | 63 | case 'success': |
| 59 | $withdraw_status = 2; | 64 | $withdraw_status = 2; |
| 65 | $query = $query->where(['withdraw_status'=>1]); | ||
| 60 | break; | 66 | break; |
| 61 | } | 67 | } |
| 62 | 68 | ||
| 63 | if (StakeholderIncomeByPayer::query()->where(['sync_status'=>1, 'identifier'=>$this->identifier->identifier]) | 69 | if ($query->update(['withdraw_status'=>$withdraw_status])) { |
| 64 | ->whereIn('serial_no', $this->request->input('serial_no'))->update([ | ||
| 65 | 'withdraw_status'=>$withdraw_status, | ||
| 66 | ])) { | ||
| 67 | return Response::success(); | 70 | return Response::success(); |
| 68 | } else { | 71 | } else { |
| 69 | return Response::error(); | 72 | return Response::error(); | ... | ... |
-
Please register or sign in to post a comment