Commit bcc8d3c2 authored by fangliyan's avatar fangliyan

base_id 取消收藏

parent a73ad66b
...@@ -884,15 +884,29 @@ class User_model extends MY_Model ...@@ -884,15 +884,29 @@ class User_model extends MY_Model
* @return string|array * @return string|array
*/ */
function getCollectHouseIdByBaseID($base_id,$kind,$houseid,$city=GB_CITY,$all=0){ function getCollectHouseIdByBaseID($base_id,$kind,$houseid,$city=GB_CITY,$all=0){
$base_id_where = "'".$base_id."'";
$base_id = explode(',',$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])) if(!empty($data[0]))
{ {
$res = array();
foreach ($data as $key => $value) {
$res[$key] = $value['id'];
}
if($all){ if($all){
return $data; return $res;
} }
return $data[0]; return $res[0];
}else{ }else{
return 0; return 0;
} }
...@@ -2460,9 +2474,6 @@ if($searcharr['infotype']==4){ ...@@ -2460,9 +2474,6 @@ if($searcharr['infotype']==4){
{ {
//设置表 //设置表
$this->user_model->set_table('personal_collection'); $this->user_model->set_table('personal_collection');
if(is_array($arr)){
$arr = implode(',',$arr);
}
//过滤表结构 //过滤表结构
$result = $this->user_model->del_mul($arr,'id','esf'); $result = $this->user_model->del_mul($arr,'id','esf');
return $result; return $result;
......
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