Commit 296d6017 296d60175a67c6bb09a25ea6e984956d8bea8b8a by lemon

*

1 parent ae45a0b1
...@@ -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();
......