Commit d5e4cad5 by Phạm Văn Đoan

fixbug export

parent 5085fd4a
......@@ -266,7 +266,13 @@ class Track_model extends CI_Model
{
//$sql = "SELECT * FROM report_views_weekly WHERE `week` = ? AND `year` = ? ORDER BY total_point DESC LIMIT {$offset}, {$limit} ";
//$query = $this->db->query($sql, $week, $year);
$this->db->from('report_views_weekly');
if (date('W') >= 14 && date('Y' >= 2020)) {
$this->db->from('report_views_weekly_new');
} else {
$this->db->from('report_views_weekly');
}
$this->db->where('week =', $week);
$this->db->where('year =', $year);
$this->db->limit($limit, $offset);
......@@ -289,7 +295,13 @@ class Track_model extends CI_Model
{
//$sql = "SELECT * FROM reports_views_monthly WHERE `month` = ? AND `year` = ? ORDER BY total_point DESC LIMIT {$offset}, {$limit} ";
//$query = $this->db->query($sql, $month, $year);
$this->db->from('reports_views_monthly');
if (date('m') >= 4 && date('Y' >= 2020)) {
$this->db->from('report_views_monthly_new');
} else {
$this->db->from('reports_views_monthly');
}
$this->db->where('month =', $month);
$this->db->where('year =', $year);
$this->db->limit($limit, $offset);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment