diff --git a/application/module/Reference/Reference.php b/application/module/Reference/Reference.php index 6fd1eb0c..01c4b54f 100644 --- a/application/module/Reference/Reference.php +++ b/application/module/Reference/Reference.php @@ -233,7 +233,7 @@ class Reference public function fetchTodoReferences() { $wheresql = array(); - $wheresql[]=" r.uuid is not null "; + $wheresql[]=" ref.id not in (select distinct refid from mdref) "; if(!empty($this->keyword)) { $wheresql[] = " (ref.title LIKE '%{$this->keyword}%' OR ref.reference LIKE '%{$this->keyword}%') "; @@ -252,7 +252,7 @@ class Reference $order = "ref.{$this->order} {$this->sort}"; } - $sql="select distinct ref.* from mdref r left join {$this->table->reference} ref on r.refid=ref.id + $sql="select distinct ref.* from {$this->table->reference} ref $wheresql ORDER BY $order"; $rs=$this->db->query($sql);