first commit
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
defined( 'BASEPATH' ) OR exit( 'No direct script access allowed' );
|
||||
|
||||
class Emission_model extends CI_Model {
|
||||
|
||||
const PERPAGE = "20";
|
||||
|
||||
// table associate
|
||||
protected $table = 'emission_model';
|
||||
// read only database
|
||||
private $read_replica;
|
||||
|
||||
public function __construct() {
|
||||
parent::__construct();
|
||||
$this->read_replica = $this->load->database('savvy_replica', TRUE);
|
||||
}
|
||||
|
||||
/**
|
||||
* get Emission records
|
||||
* @param int $paged pagination number
|
||||
* @return array
|
||||
*/
|
||||
public function getData($paged = 0) {
|
||||
$this->read_replica->select('*');
|
||||
$this->read_replica->from($this->table);
|
||||
$this->read_replica->order_by('lorder', 'ASC');
|
||||
$this->read_replica->limit(self::PERPAGE, $paged);
|
||||
$query = $this->read_replica->get();
|
||||
|
||||
return $query;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user