nhance/app/Models/ClientRMModel.php

31 lines
679 B
PHP

<?php
namespace App\Models;
use CodeIgniter\Model;
class ClientRMModel extends Model
{
protected $table = 'client_rm';
protected $primaryKey = 'id';
protected $allowedFields = [
"id",
"client_id",
"user_id",
"level",
"created_by",
"updated_by",
"is_active",
];
public function checkExistenceOfClientRelation($id, $user_id, $level)
{
$query = $this->where('client_id', $id)
->where('user_id', $user_id)
->where('level', $level)
->countAllResults();
return ($query > 0) ? true : false;
}
}