Commit 1a71e95d by Phạm Văn Đoan

fix lỗi ko hiểu tên bảng khi join

parent 5d595a6b
...@@ -352,12 +352,12 @@ class Track_model extends CI_Model ...@@ -352,12 +352,12 @@ class Track_model extends CI_Model
$this->db->join('crawler_listens', 'crawler_listens.track_id = tracks.id'); $this->db->join('crawler_listens', 'crawler_listens.track_id = tracks.id');
$this->db->where('crawler_listens.created_at <=', $six_month_ago); $this->db->where('crawler_listens.created_at <=', $six_month_ago);
if ($name != null) { if ($name != null) {
$this->db->like('title', $name, 'both'); $this->db->like('tracks.title', $name, 'both');
$this->db->or_like('description', $name, 'both'); $this->db->or_like('tracks.description', $name, 'both');
$this->db->or_like('slug', $name, 'both'); $this->db->or_like('tracks.slug', $name, 'both');
$this->db->or_like('slug', MyHelper::genSlug($name), 'both'); $this->db->or_like('tracks.slug', MyHelper::genSlug($name), 'both');
$this->db->or_like('tag', $name, 'both'); $this->db->or_like('tracks.tag', $name, 'both');
$this->db->or_where('id', intval($name)); $this->db->or_where('tracks.id', intval($name));
} }
if (!empty($fBySource)) { if (!empty($fBySource)) {
switch ($fBySource) { switch ($fBySource) {
...@@ -414,7 +414,7 @@ class Track_model extends CI_Model ...@@ -414,7 +414,7 @@ class Track_model extends CI_Model
$this->db->or_like('tracks.slug', $name, 'both'); $this->db->or_like('tracks.slug', $name, 'both');
$this->db->or_like('tracks.slug', MyHelper::genSlug($name), 'both'); $this->db->or_like('tracks.slug', MyHelper::genSlug($name), 'both');
$this->db->or_like('tracks.tag', $name, 'both'); $this->db->or_like('tracks.tag', $name, 'both');
$this->db->or_where('id', intval($name)); $this->db->or_where('tracks.id', intval($name));
} }
if (!empty($fBySource)) { if (!empty($fBySource)) {
switch ($fBySource) { switch ($fBySource) {
......
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