下午好 伙计我被困在这里的一个问题我无法解决它所以不得不问这里。问题是我想加载两个函数
"Website:"
&安培;
function FETCH_DATA($HOTEL_ID){
$this->db->where(['hotel_id' => $HOTEL_ID]);
$DATA = $this->db->get('hotel_tbl');
return $DATA->result();
}
来自我function FETCH_ASSOCIATION($HOTEL_ID){
$this->db->where(['hotel_id' => $HOTEL_ID]);
$ASSOCIATION = $this->db->get('hotel_association');
return $ASSOCIATION->result();
}
AdminModel.php
的代码如下
AdminController.php
任何帮助将不胜感激!
答案 0 :(得分:1)
您可以调用更多模态函数并将数据发送到如下所示的视图
function DESCRIPTION(){
$this->load->model('AdminModel');
$HOTEL_ID = $this->session->userdata('hotel_id');
$a['data1'] = $this->AdminModel->FETCH_DATA($HOTEL_ID);
$a['data2'] = $this->AdminModel->FETCH_ASSOCIATION($HOTEL_ID);
$this->load->view("Description", $a);
}
答案 1 :(得分:1)
传递像这样的变量,
$a['data1'] = $this->AdminModel->FETCH_DATA($HOTEL_ID);
$a['data2'] = $this->AdminModel->FETCH_ASSOCIATION($HOTEL_ID);
你很高兴!!