2016-08-26 91 views
0

消息:笨:数组字符串转换解决方案

阵列字符串转换

文件名称: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;  
} 
+0

请发布如何调用此功能与细节参数。 –

回答

0

在你的函数$必须在其中阵列,但不知道它的类型。

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