CHANGE_ in doc_verify_otp API : GWM
This commit is contained in:
parent
6798357556
commit
78f5760f9c
@ -797,7 +797,7 @@ class MasterController extends BaseController
|
||||
|
||||
public function doc_generate_otp()
|
||||
{
|
||||
// try {
|
||||
try {
|
||||
$mobile_no = $this->request->getPost('mobile_no');
|
||||
$client_data = $this->ClientBranchModel->where('mobile_no', $mobile_no )->first();
|
||||
if($client_data){
|
||||
@ -828,10 +828,10 @@ class MasterController extends BaseController
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
// } catch (\Exception $e) {
|
||||
// // Handle any exceptions that occur during execution
|
||||
// return $this->response->setJSON(['status' => 'error', 'code' => 500, 'message' => $e->getMessage()], 500);
|
||||
// }
|
||||
} catch (\Exception $e) {
|
||||
// Handle any exceptions that occur during execution
|
||||
return $this->response->setJSON(['status' => 'error', 'code' => 500, 'message' => $e->getMessage()], 500);
|
||||
}
|
||||
}
|
||||
|
||||
public function doc_verify_otp()
|
||||
@ -839,30 +839,39 @@ class MasterController extends BaseController
|
||||
try {
|
||||
$id = $this->request->getPost('doc_id');
|
||||
$otp = $this->request->getPost('otp');
|
||||
if($this->session->has('is_client_logged_in')){
|
||||
$logged_user = $this->session->get('is_client_logged_in');
|
||||
$statusData['is_staff'] = 0;
|
||||
}else{
|
||||
$logged_user = $this->session->get('is_staff_logged_in');
|
||||
$statusData['is_staff'] = 1;
|
||||
}
|
||||
|
||||
$client_doc_data = $this->ClientDocsModel->where('id', $id )->where('otp', $otp)->first();
|
||||
$data = ['otp' =>'' ,'rejection_reason' =>''];
|
||||
|
||||
if($client_doc_data){
|
||||
|
||||
//update status
|
||||
$data['is_approved'] = $this->request->getPost('is_approved');
|
||||
$data['ip_address'] = $this->request->getPost('clientIp');
|
||||
$update = $this->ClientDocsModel->update($id , $data);
|
||||
|
||||
//create history data
|
||||
if($this->session->has('is_client_logged_in')){
|
||||
$logged_user = $this->session->get('is_client_logged_in');
|
||||
$statusData['is_staff'] = 0;
|
||||
}else if($this->session->has('is_staff_logged_in')){
|
||||
$logged_user = $this->session->get('is_staff_logged_in');
|
||||
$statusData['is_staff'] = 1;
|
||||
}else{
|
||||
$logged_user = $client_doc_data['client_branch_id'];
|
||||
$statusData['is_staff'] = 0;
|
||||
}
|
||||
$statusData['client_docs_id'] = $id;
|
||||
$statusData['created_by'] = $logged_user;
|
||||
$statusData['status'] = 'Approved';
|
||||
$statusData['note'] = $this->request->getPost('clientIp');
|
||||
$this->DocsStatusModel->insert($statusData);
|
||||
|
||||
$client_doc_data = $this->ClientDocsModel->where('id', $id )->where('otp', $otp)->first();
|
||||
$data = ['otp' =>'' ,'rejection_reason' =>''];
|
||||
if($client_doc_data){
|
||||
$data['is_approved'] = $this->request->getPost('is_approved');
|
||||
$data['ip_address'] = $this->request->getPost('clientIp');
|
||||
$update = $this->ClientDocsModel->update($id , $data);
|
||||
|
||||
|
||||
if($update){
|
||||
return json_encode(true);
|
||||
}
|
||||
|
||||
} else {
|
||||
return json_encode('');
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user