bb_sign/app/Models/ClientDocsModel.php

25 lines
631 B
PHP

<?php namespace App\Models;
use CodeIgniter\Model;
class ClientDocsModel extends Model
{
protected $table = 'client_docs';
protected $primaryKey = 'id';
protected $allowedFields = ['client_id','template_id','is_active' ,'created_by','updated_by'];
public function getTemplate($client_id){
$this->select('template.*,client_docs.is_approved');
$this->join('template', 'template.template_id = client_docs.template_id');
$this->where('client_docs.is_active', 1);
$this->where('client_docs.client_id', $client_id);
return $this->findAll();
}
}