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()
|
public function doc_generate_otp()
|
||||||
{
|
{
|
||||||
// try {
|
try {
|
||||||
$mobile_no = $this->request->getPost('mobile_no');
|
$mobile_no = $this->request->getPost('mobile_no');
|
||||||
$client_data = $this->ClientBranchModel->where('mobile_no', $mobile_no )->first();
|
$client_data = $this->ClientBranchModel->where('mobile_no', $mobile_no )->first();
|
||||||
if($client_data){
|
if($client_data){
|
||||||
@ -828,10 +828,10 @@ class MasterController extends BaseController
|
|||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// } catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
// // Handle any exceptions that occur during execution
|
// Handle any exceptions that occur during execution
|
||||||
// return $this->response->setJSON(['status' => 'error', 'code' => 500, 'message' => $e->getMessage()], 500);
|
return $this->response->setJSON(['status' => 'error', 'code' => 500, 'message' => $e->getMessage()], 500);
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function doc_verify_otp()
|
public function doc_verify_otp()
|
||||||
@ -839,12 +839,27 @@ class MasterController extends BaseController
|
|||||||
try {
|
try {
|
||||||
$id = $this->request->getPost('doc_id');
|
$id = $this->request->getPost('doc_id');
|
||||||
$otp = $this->request->getPost('otp');
|
$otp = $this->request->getPost('otp');
|
||||||
|
|
||||||
|
$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')){
|
if($this->session->has('is_client_logged_in')){
|
||||||
$logged_user = $this->session->get('is_client_logged_in');
|
$logged_user = $this->session->get('is_client_logged_in');
|
||||||
$statusData['is_staff'] = 0;
|
$statusData['is_staff'] = 0;
|
||||||
}else{
|
}else if($this->session->has('is_staff_logged_in')){
|
||||||
$logged_user = $this->session->get('is_staff_logged_in');
|
$logged_user = $this->session->get('is_staff_logged_in');
|
||||||
$statusData['is_staff'] = 1;
|
$statusData['is_staff'] = 1;
|
||||||
|
}else{
|
||||||
|
$logged_user = $client_doc_data['client_branch_id'];
|
||||||
|
$statusData['is_staff'] = 0;
|
||||||
}
|
}
|
||||||
$statusData['client_docs_id'] = $id;
|
$statusData['client_docs_id'] = $id;
|
||||||
$statusData['created_by'] = $logged_user;
|
$statusData['created_by'] = $logged_user;
|
||||||
@ -852,17 +867,11 @@ class MasterController extends BaseController
|
|||||||
$statusData['note'] = $this->request->getPost('clientIp');
|
$statusData['note'] = $this->request->getPost('clientIp');
|
||||||
$this->DocsStatusModel->insert($statusData);
|
$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){
|
if($update){
|
||||||
return json_encode(true);
|
return json_encode(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
return json_encode('');
|
return json_encode('');
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user