我想創建志願者數據庫中的用戶列表,基於那些活躍成員以及他們志願參加的工作。codeigniter倍數或在哪裏,無視哪裏不是
問題是,它也包括非活動成員。
這裏是我的控制器
function View_Vol_LIST()
{
$data = array();
if($query = $this->report_model->Volunteer_list())
{
$data['records'] = $query;
}
$data['main_content'] = 'volunteer_list';
$this->load->view('includes/template', $data);
}
這裏是我的模型
function Volunteer_list()
{
$query = $this->db->order_by('Last_Name', "ASC");
$query = $this->db->order_by('First_Name', "ASC");
$query = $this->db->where('Membership_Status !=', 'DNR');
$query = $this->db->where('Vol_FA =', 'yes');
$query = $this->db->or_where('Vol_TEL =', 'yes');
$query = $this->db->or_where('Vol_CD =', 'yes');
$query = $this->db->or_where('Vol_SCBA =', 'yes');
$query = $this->db->or_where('Vol_MAIL =', 'yes');
$query = $this->db->or_where('Vol_SML =', 'yes');
$query = $this->db->or_where('Vol_BODCOM =', 'yes');
$query = $this->db->or_where('Vol_OTHER =', 'yes');
$query = $this->db->get('Membership');
return $query->result();
看來,or_where完全覆蓋的地方!= DNR(沒有續約)
幫助!
謝謝!
回聲這個 - > DB-> last_query()我敢打賭,邏輯是不是你期望它你可能不得不手工編寫它來獲得括號中正確的地方 –