1

我在使用活动记录时遇到问题 or_where
我如何做或仅针对一个特定字段,即 meeting_status

$this->db->_protect_identifiers=false;
        $this->db->select("g.category_id,f.doc_type_id,g.category_name,f.doc_type_name,c.meeting_name_id, c.meeting_name as mn, d.meeting_type_id, d.meeting_type_name, e.venue_id, e.venue_name, u.*, (select count(*) from tbl_meeting_decisions where meeting_id=u.meeting_id and record_status= 'ACTIVE') as `meeting_decision`, (select count(*) from tbl_meeting_actions  where meeting_id=u.meeting_id and record_status= 'ACTIVE') as `meeting_action`, (select count(*) from tbl_meeting_actions  where meeting_id=u.meeting_id and action_status='OPEN' and record_status= 'ACTIVE') as `meeting_close_action`");
        $this->db->from('tbl_meeting_plans u');
        $this->db->join('tbl_meeting_names c', 'c.meeting_name_id = u.meeting_name');
        $this->db->join('tbl_meeting_types d', 'd.meeting_type_id = u.meeting_mode_id');
        $this->db->join('tbl_meeting_venue e', 'e.venue_id = u.venue_id ');
        $this->db->join('tbl_document_types f', 'f.doc_type_id = u.meeting_type_id ');
        $this->db->join('tbl_categories g', 'g.category_id = u.meeting_category_id ');

             $this->db->where(array('u.meeting_type_id'=>$str2,'u.meeting_category_id'=>$str1,'u.meeting_status'=>'Planning','u.record_status'=>'ACTIVE'  ));
$this->db->or_where(array('u.meesting_status'=>'Meeting Updated' ));
4

1 回答 1

4
 $where = "(u.meeting_status='Planning' or u.meeting_status='Meeting
 Updated') "; 
 $this->db->where($where);

在此之前使用正常的 where 子句

于 2013-05-31T09:37:04.847 回答