24 lines
552 B
PHP
24 lines
552 B
PHP
<?php
|
|
if (!defined('BASEPATH'))
|
|
exit('No direct script access allowed');
|
|
|
|
class Staff_model extends CI_Model {
|
|
|
|
public function __construct() {
|
|
parent::__construct();
|
|
}
|
|
|
|
function list_staffs($id=0)
|
|
{
|
|
$this->db->select('s.*,r.name as rolename');
|
|
$this->db->from('staff as s');
|
|
$this->db->join('staff_roles as r','r.id=s.role','inner');
|
|
$this->db->where(array('s.status'=>1));
|
|
if($id!=0){$this->db->where(array('s.id'=>$id));}
|
|
$query = $this->db->get();
|
|
//echo $this->db->last_query();exit;
|
|
return $query;
|
|
}
|
|
|
|
}
|