53 lines
1.3 KiB
PHP
Executable File
53 lines
1.3 KiB
PHP
Executable File
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use CodeIgniter\Model;
|
|
|
|
class LevelContactModel extends Model
|
|
{
|
|
protected $table = 'level_contacts';
|
|
protected $primaryKey = 'id';
|
|
protected $allowedFields = [
|
|
"id",
|
|
"ref_id",
|
|
"contact_type",
|
|
"level",
|
|
"name",
|
|
"email",
|
|
"city",
|
|
"mobile",
|
|
"designation",
|
|
"created_by",
|
|
"updated_by",
|
|
"otp",
|
|
"is_active",
|
|
"token_time_out"
|
|
];
|
|
|
|
|
|
public function getContectForRFQ(){
|
|
|
|
$result = $this
|
|
|
|
->select('
|
|
level_contacts.id,
|
|
insurers.short_name as insurer_name,
|
|
insurer_branch.branch_code,
|
|
level_contacts.name as contect_person_name,
|
|
level_contacts.email as contect_person_email,
|
|
')
|
|
->join('insurer_branch', 'level_contacts.ref_id = insurer_branch.id')
|
|
->join('insurers', 'insurer_branch.insurer_id = insurers.id')
|
|
->where('level_contacts.contact_type', 'insurer')
|
|
->where('level_contacts.is_active', 1)
|
|
->where('insurer_branch.is_active', 1)
|
|
->where('insurers.is_active', 1)
|
|
->findAll();
|
|
|
|
return $result;
|
|
|
|
}
|
|
|
|
}
|