FIX_LEVEL_CONTACT_QUERY : RV
This commit is contained in:
parent
b32e9f80ac
commit
33a07a816e
@ -2286,8 +2286,16 @@ class ClientController extends AdminController
|
||||
public function checkHRNumber($mobileNumber)
|
||||
{
|
||||
try {
|
||||
$mobileNumberCount = $this->levelContactModel->where('mobile', $mobileNumber)->countAllResults();
|
||||
return $this->respond(['status' => true, 'data' => $mobileNumberCount], 200);
|
||||
$mobileNumberCount = $this->levelContactModel
|
||||
->join('client_branch', 'client_branch.id = level_contacts.ref_id')
|
||||
->join('clients', 'clients.id = client_branch.client_id')
|
||||
->where('clients.is_active', 1)
|
||||
->where('client_branch.is_active', 1)
|
||||
->where('level_contacts.is_active', 1)
|
||||
->where('level_contacts.contact_type', 'client')
|
||||
->where('level_contacts.mobile', $mobileNumber)
|
||||
->countAllResults();
|
||||
return $this->respond(['status' => true, 'data' => $mobileNumberCount, 'message' => "try"], 200);
|
||||
} catch (\Exception $e) {
|
||||
log_message('error', 'Error checking mobile number: ' . $e->getMessage());
|
||||
return $this->respond(['status' => false, 'data' => 0, 'message' => 'An error occurred while checking the mobile number. Please try again later.'], 500);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user