37 lines
805 B
PHP
Executable File
37 lines
805 B
PHP
Executable File
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use CodeIgniter\Model;
|
|
|
|
class InsurerBranchModel extends Model
|
|
{
|
|
protected $table = 'insurer_branch';
|
|
protected $primaryKey = 'id';
|
|
protected $allowedFields = [
|
|
"id",
|
|
"insurer_id",
|
|
"branch_name",
|
|
"branch_code",
|
|
"address1",
|
|
"address2",
|
|
"city",
|
|
"district",
|
|
"state",
|
|
"pincode",
|
|
"created_by",
|
|
"updated_by",
|
|
"is_active",
|
|
];
|
|
|
|
|
|
public function getInsurerBranchesWithInsurerNames()
|
|
{
|
|
$query = $this->select('insurer_branch.*, I.short_name as insurer_name, I.category')
|
|
->join('insurers I', 'insurer_branch.insurer_id = I.id', 'left')
|
|
->find();
|
|
return $query;
|
|
}
|
|
|
|
}
|