Codeigniter:数组到字符串的转换解决方案



留言:

数组到字符串的转换

文件名:models/db_get.php

function get_where_conditions1($tb,$where)
{           
    $this->db->select('*');
    $this->db->distinct();
    $this->db->from($tb);
    $this->db->join("restaurants", $tb.".".'restaurant_id = restaurants.id',"LEFT");
    $this->db->where_in('branches.'.'$where');
    $this->db->order_by('branches.id','desc');
    $query=  $this->db->get()->result_array();
    $out=array_unique($query);    
    return  $out;      
}

在你的函数$where必须是数组,但不知道它的类型

我认为问题在$this->db->where_in('branches.'.'$where');应该是$this->db->where_in('branches',$where);

相关内容

最新更新