Commit 6f36806a authored by fangliyan's avatar fangliyan

PC收藏相关

parent 4f684d9a
......@@ -806,7 +806,29 @@ class User_model extends MY_Model
if($jmz==1){
$uidnum = $this->get_data(array('form_name' => 'personal_collection','where'=>array('passport_uid'=>$uid,'kind'=>$kind,'city_name'=>$city),'select'=>array('count(*) as num')),'esfbak');
}else{
$uidnum = $this->get_data(array('form_name' => 'personal_collection','where'=>array('uid'=>$uid,'kind'=>$kind,'city_name'=>$city),'select'=>array('count(*) as num')),'esfbak');
$user_array = $this->get_data(array('form_name' => 'personal_user','where'=>array('id'=>$uid),'select'=>array('passport_uid')),'esfbak');
$base_id = '';
if(!empty($user_array)){
$passport_uid = $user_array[0]['passport_uid'];
$base_id_url = 'http://localnewrent.house365.com/api/tf-app/get-base-id?keyword='.$passport_uid;
$base_id = curl_get_contents($base_id_url);
}
$base_id_where = "'".$base_id."'";
if($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,',');
}
}
if($base_id){
$uidnum = $this->get_data(array('form_name' => 'personal_collection','where'=>"base_id in ($base_id_where) and kind=$kind and city_name='$city'",'select'=>array('count(*) as num')),'esfbak');
}else {
$uidnum = $this->get_data(array('form_name' => 'personal_collection', 'where' => array('uid' => $uid, 'kind' => $kind, 'city_name' => $city), 'select' => array('count(*) as num')), 'esfbak');
}
}
......@@ -1098,12 +1120,35 @@ class User_model extends MY_Model
$this->memcached_class->delete($key);
}
$collect_array = $this->memcached_class->get($key);
// $collect_array = $this->memcached_class->get($key);
if(empty($collect_array) )
{
$collect_array = $this->get_data(array('form_name' => 'personal_collection','where'=>array('uid'=>(int)$uid,'kind'=>$kind,'city_name'=>$city),'limit'=>$pagesize,'offset'=>$offset,'order_by'=>'collect_time desc'),'esfbak');
$user_array = $this->get_data(array('form_name' => 'personal_user','where'=>array('id'=>$uid),'select'=>array('passport_uid')),'esfbak');
$base_id = '';
if(!empty($user_array)){
$passport_uid = $user_array[0]['passport_uid'];
$base_id_url = 'http://localnewrent.house365.com/api/tf-app/get-base-id?keyword='.$passport_uid;
$base_id = curl_get_contents($base_id_url);
}
$base_id_where = "'".$base_id."'";
if($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,',');
}
}
if($base_id){
$collect_array = $this->get_data(array('form_name' => 'personal_collection','where'=>"base_id in ($base_id_where) and kind=$kind and city_name='$city'",'limit'=>$pagesize,'offset'=>$offset,'order_by'=>'collect_time desc'),'esfbak');
}else{
$collect_array = $this->get_data(array('form_name' => 'personal_collection','where'=>array('uid'=>(int)$uid,'kind'=>$kind,'city_name'=>$city),'limit'=>$pagesize,'offset'=>$offset,'order_by'=>'collect_time desc'),'esfbak');
}
//获取虚拟号码
foreach($collect_array as &$value){
$collect_value = unserialize($value['collect_value']);
......@@ -4647,7 +4692,7 @@ if($searcharr['infotype']==4){
$this->memcached_class->delete($key);
}
$block = $this->memcached_class->get($key);
// $block = $this->memcached_class->get($key);
if( empty($block) )
{
......@@ -4671,7 +4716,7 @@ if($searcharr['infotype']==4){
}
if($base_id){
$sql = "select collect_id from personal_collection where base_id in ($base_id_where) and city_name = '$city' and kind = 2 and collect_id <> 0
order by collect_time desc limit $offset,$pagesize";
order by collect_time desc ";
$query = $this->db_esfbak->query($sql);
$block_array = $query->result_array();
}else{
......@@ -4689,7 +4734,7 @@ if($searcharr['infotype']==4){
if($base_id){
$sql = "select collect_id from personal_collection where base_id in ($base_id_where) and city_name = '$city' and kind = 3 and collect_id <> 0
order by collect_time desc limit $offset,$pagesize";
order by collect_time desc";
$query = $this->db_esfbak->query($sql);
$sell_array = $query->result_array();
}else{
......@@ -4720,15 +4765,13 @@ if($searcharr['infotype']==4){
if($base_id){
$sql = "select collect_id from personal_collection where base_id in ($base_id_where) and city_name = '$city' and kind = 4 and collect_id <> 0
order by collect_time desc limit $offset,$pagesize";
order by collect_time desc";
$query = $this->db_esfbak->query($sql);
$rent_array = $query->result_array();
}else{
$rent_array = $this->get_data(array('form_name' => 'personal_collection','where'=>array('uid'=>$uid,'city_name'=>$city,'collect_id <>'=>0,'kind'=>4),'select'=>array('collect_id')),'esfbak');
}
if(is_array($rent_array) && !empty($rent_array))
{
foreach($rent_array as $value)
......
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