Commit 175f953d authored by fangliyan's avatar fangliyan

base_id 取消收藏

parent c41ba262
......@@ -1089,6 +1089,49 @@ class Esf_center_api extends MY_Controller {
echo serialize($arr);
}
/**
* 获取用户关注房源操作接口
* @author cxf
*/
public function get_focus_house_list()
{
$base_id = $this->input->get('base_id');
if(!$base_id)
{
echo serialize(array());exit;
}
$kind = $this->input->get('kind');
$page = $this->input->get('page');
$pagesize = $this->input->get('pagesize');
$city = $this->input->get('city');
$page = $page ? $page:1;
$pagesize = $pagesize?$pagesize : 20;
$offset = $pagesize * ($page-1);
$this->load->model("userTest_model");
$collect_array = $this->user_model->getcollectByBaseId($kind,$base_id,$offset,$pagesize,$city);
if(!empty($collect_array) && is_array($collect_array))
{
foreach($collect_array as $key=>$value)
{
$collect_value = unserialize($value['collect_value']);
$collect_value['collect_time'] = $value['collect_time'];
$arr[$key]['value'] = serialize($collect_value);
}
}
else
{
$arr=array();
}
echo serialize($arr);
}
/**
* 获得用户id接口
......
......@@ -6174,6 +6174,44 @@ if($searcharr['infotype']==4){
return $collect_array;
}
/**
* 获取关注信息通过base_id
* @param type $base_id
* @return string
*/
function getcollectByBaseId($kind,$base_id,$offset=0,$pagesize=0,$city=GB_CITY)
{
$pagesize = $pagesize ? $pagesize : 20;
$key = $this->memkey.'getcollectByBaseId'.$uid.$kind.$offset.$pagesize.$city;
if($this->input->get('update') == 1)
{
$this->memcached_class->delete($key);
}
$collect_array = $this->memcached_class->get($key);
if(empty($collect_array) )
{
$base_id_where = "'".$base_id."'";
$base_id = explode(',',$base_id);
if(count($base_id)>1){
$base_id_where = '';
foreach ($base_id as $key => $value) {
$base_id_where .= "'".$value."',";
}
$base_id_where = rtrim($base_id_where,',');
}
$sql = "select * from personal_collection where base_id in ($base_id_where) and city_name = '$city' and kind = $kind
order by collect_time desc limit $offset,$pagesize";
$query = $this->db_esfbak->query($sql);
$collect_array = $query->result_array();
$this->memcached_class->add($key, $collect_array,1);
}
return $collect_array;
}
/**
* 验证优惠券
* @param $user_id
......
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