| Server IP : 103.48.194.25 / Your IP : 216.73.216.47 Web Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.33 System : Linux VMHostDefault 3.10.0-1160.42.2.el7.x86_64 #1 SMP Tue Sep 7 14:49:57 UTC 2021 x86_64 User : sieuthimay ( 1016) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/zomuaban.com/public_html/site/models/ |
Upload File : |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Report_model extends CI_Model
{
public function __construct()
{
parent::__construct();
$this->load->database();
}
public function get_report_by_type($type = 1) {
# Lấy tin cùng kiểu & (của user đó hoặc đã active)
$this->db->where('type', $type);
$this->db->or_having(array('email =' => mine()->email , 'status >'=>0));
$this->db->limit(20);
$this->db->order_by('update_time desc');
$this->db->order_by('totalUp desc');
$query = $this->db->get('report');
if ($query->num_rows() > 0) {
return $query->result();
}else {
return false;
}
}
public function get_report_by_id($id){
$this->db->where('id', $id);
$this->db->where('status >', 0);
$query = $this->db->get('report');
if ($query->num_rows() > 0) {
return $query->result()[0];
}else {
return false;
}
}
}