Commit 324a12db authored by fangliyan's avatar fangliyan

Merge branch 'refs/heads/subscribe2.0' into release_dev_107

parents 7abcd54d bcc8d3c2
......@@ -884,15 +884,29 @@ class User_model extends MY_Model
* @return string|array
*/
function getCollectHouseIdByBaseID($base_id,$kind,$houseid,$city=GB_CITY,$all=0){
$base_id_where = "'".$base_id."'";
$base_id = explode(',',$base_id);
$data = $this->get_data(array('form_name' => 'personal_collection','where_in'=>array('base_id'=>$base_id),'where'=>array('collect_id'=>$houseid,'city_name'=>$city,'kind'=>$kind),'select'=>array('id')),'esf');
if(count($base_id)>1){
foreach ($base_id as $key => $value) {
$base_id_where .= "'".$value."',";
}
$base_id_where = rtrim($base_id_where,',');
}
$sql = "select id from personal_collection where base_id in ($base_id_where) and collect_id = $houseid and city_name = '$city' and kind = $kind";
$query = $this->db_esfbak->query($sql);
$data = $query->result_array();
if(!empty($data[0]))
{
$res = array();
foreach ($data as $key => $value) {
$res[$key] = $value['id'];
}
if($all){
return $data;
return $res;
}
return $data[0];
return $res[0];
}else{
return 0;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment