Commit 42b6fd72 by Phạm Văn Đoan

fix lỗi ko xuất báo cáo tuần do có cả data hệ thống cũ

parent efd0304d
...@@ -6,6 +6,8 @@ class Track_model extends CI_Model ...@@ -6,6 +6,8 @@ class Track_model extends CI_Model
protected $_table_user = 'users'; protected $_table_user = 'users';
protected $_table_track_user = 'track_user'; protected $_table_track_user = 'track_user';
protected $_table_track_artists = 'track_artists'; protected $_table_track_artists = 'track_artists';
protected $_table_report_views_weekly = 'report_views_weekly_new';
protected $_table_report_views_monthly = 'report_views_monthly_new';
public function __construct() public function __construct()
{ {
...@@ -507,12 +509,7 @@ class Track_model extends CI_Model ...@@ -507,12 +509,7 @@ class Track_model extends CI_Model
//$sql = "SELECT * FROM report_views_weekly WHERE `week` = ? AND `year` = ? ORDER BY total_point DESC LIMIT {$offset}, {$limit} "; //$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); //$query = $this->db->query($sql, $week, $year);
if ($week >= 14 && $year >= 2020) { $this->db->from($this->_table_report_views_weekly);
$this->db->from('report_views_weekly_new');
} else {
$this->db->from('report_views_weekly');
}
$this->db->where('week =', $week); $this->db->where('week =', $week);
$this->db->where('year =', $year); $this->db->where('year =', $year);
$this->db->limit($limit, $offset); $this->db->limit($limit, $offset);
...@@ -536,11 +533,7 @@ class Track_model extends CI_Model ...@@ -536,11 +533,7 @@ class Track_model extends CI_Model
//$sql = "SELECT * FROM reports_views_monthly WHERE `month` = ? AND `year` = ? ORDER BY total_point DESC LIMIT {$offset}, {$limit} "; //$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); //$query = $this->db->query($sql, $month, $year);
if ($month >= 4 && $year >= 2020) { $this->db->from($this->_table_report_views_monthly);
$this->db->from('report_views_monthly_new');
} else {
$this->db->from('reports_views_monthly');
}
$this->db->where('month =', $month); $this->db->where('month =', $month);
$this->db->where('year =', $year); $this->db->where('year =', $year);
......
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