FIX_DUPLICAT_ENTRY
This commit is contained in:
parent
107966a73d
commit
b36a648995
@ -613,8 +613,13 @@ class AgentController extends ResourceController
|
|||||||
try{
|
try{
|
||||||
$data = $this->request->getPost();
|
$data = $this->request->getPost();
|
||||||
|
|
||||||
//duplicate check
|
//duplicate check (ignore soft-deleted rows)
|
||||||
$duplicateData = $this->AgentIncentiveFileModel->where('agent_id',$data['agent_id'])->where('incentive_month',$data['incentive_month'])->where('file_type','incentive')->first();
|
$duplicateData = $this->AgentIncentiveFileModel
|
||||||
|
->where('agent_id', $data['agent_id'])
|
||||||
|
->where('incentive_month', $data['incentive_month'])
|
||||||
|
->where('file_type', 'incentive')
|
||||||
|
->where('is_active', 1)
|
||||||
|
->first();
|
||||||
if(!empty($duplicateData)){
|
if(!empty($duplicateData)){
|
||||||
return $this->respond(['status' => 'failed', 'code' => 200, 'data' => 'Duplicate Entry.'], 200);
|
return $this->respond(['status' => 'failed', 'code' => 200, 'data' => 'Duplicate Entry.'], 200);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user