Commit 296d6017 296d60175a67c6bb09a25ea6e984956d8bea8b8a by lemon

*

1 parent ae45a0b1
......@@ -48,22 +48,25 @@ class MusicianWithdrawService extends Service
{
$withdraw_status = '';
$query = StakeholderIncomeByPayer::query()->where(['sync_status'=>1, 'identifier'=>$this->identifier->identifier])
->whereIn('serial_no', $this->request->input('serial_no'));
switch ($this->request->input('type')) {
case 'fail':
$withdraw_status = 0;
$query = $query->where(['withdraw_status'=>1]);
break;
case 'advance':
$withdraw_status = 1;
$query = $query->where(['withdraw_status'=>0]);
break;
case 'success':
$withdraw_status = 2;
$query = $query->where(['withdraw_status'=>1]);
break;
}
if (StakeholderIncomeByPayer::query()->where(['sync_status'=>1, 'identifier'=>$this->identifier->identifier])
->whereIn('serial_no', $this->request->input('serial_no'))->update([
'withdraw_status'=>$withdraw_status,
])) {
if ($query->update(['withdraw_status'=>$withdraw_status])) {
return Response::success();
} else {
return Response::error();
......