FIX_CHANGE

This commit is contained in:
VENKATESHWARAN 2025-11-05 09:18:11 +05:30
parent a76585137c
commit 0b4ff58661

View File

@ -3436,21 +3436,15 @@ class EmployeeRestController extends AdminController
if (!empty($client_short_name)) {
log_message('error', 'STEP 3: Looking up client with short_name: ' . $client_short_name);
// $client_data = $this->clientModel
// ->where('is_active', 1)
// ->where('short_name', $client_short_name)
// ->first();
$client_data = $this->clientModel
->where('is_active', 1)
->where('short_name', $client_short_name)
->first();
$sql = "SELECT * FROM clients WHERE is_active = 1 AND short_name = ? LIMIT 1";
$client_data = db_connect()->query($sql, [$client_short_name])->getRowArray();
// $sql = "SELECT * FROM clients WHERE is_active = 1 AND short_name = ? LIMIT 1";
// $client_data = db_connect()->query($sql, [$client_short_name])->getRowArray();
log_message('error', 'STEP 3: Looking up client with short_name: ' . db_connect()->getLastQuery());
log_message('error', 'STEP 3: Looking up client with short_name: ' . var_dump($client_data) );
log_message('error', 'STEP 3: Looking up client with short_name: ' . is_array($client_data) && count($client_data));
log_message('error', 'STEP 3: Looking up client with short_name: ' . json_encode($client_data));
if (is_array($client_data) && count($client_data)) {
if (!empty($client_data)) {
$clientId = $client_data['id'];
log_message('error', 'STEP 4: Found client ID: ' . $clientId);
} else {