Commit c3c8fa98 authored by yanghui's avatar yanghui

收藏列表优化

parent b7c96a10
......@@ -861,12 +861,15 @@ class Esf_center_api extends MY_Controller {
$pagesize = $pagesize?$pagesize : 20;
$offset = $pagesize * ($page-1);
$collect_array = $this->user_model->getcollect($kind,$uid,$pagesize,$offset,$city);
$collect_array = $this->user_model->getcollect($kind,$uid,$offset,$pagesize,$city);
if(!empty($collect_array) && is_array($collect_array))
{
foreach($collect_array as $key=>$value)
{
$arr[$key]['id'] = $value['collect_id'];
$collect_value = unserialize($value['collect_value']);
$collect_value['collect_time'] = $value['collect_time'];
$arr[$key]['value'] = serialize($collect_value);
}
}
else
......@@ -903,7 +906,7 @@ class Esf_center_api extends MY_Controller {
$this->load->model("userTest_model");
$collect_array = $this->user_model->getcollect2($kind,$uid,$pagesize,$offset,$city);
$collect_array = $this->user_model->getcollect2($kind,$uid,$offset,$pagesize,$city);
if(!empty($collect_array) && is_array($collect_array))
......
......@@ -1034,7 +1034,7 @@ class User_model extends MY_Model
*/
function getcollect($kind,$uid,$offset=0,$pagesize=0,$city=GB_CITY)
{
$pagesize = $pagesize ? $pagesize : 20;
$key = $this->memkey.'getcollect'.$uid.$kind.$offset.$pagesize.$city;
$this->memcached_class->delete($key);
......@@ -1048,7 +1048,7 @@ class User_model extends MY_Model
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'=>20,'offset'=>$offset,'order_by'=>'collect_time desc'),'esfbak');
$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']);
......@@ -6095,6 +6095,7 @@ if($searcharr['infotype']==4){
*/
function getcollect2($kind,$uid,$offset=0,$pagesize=0,$city=GB_CITY)
{
$pagesize = $pagesize ? $pagesize : 20;
$key = $this->memkey.'getcollect'.$uid.$kind.$offset.$pagesize.$city;
if($this->input->get('update') == 1)
{
......@@ -6105,7 +6106,7 @@ if($searcharr['infotype']==4){
if(empty($collect_array) )
{
$collect_array = $this->get_data(array('form_name' => 'personal_collection','where'=>array('uid'=>$uid,'kind'=>$kind,'city_name'=>$city),'limit'=>$offset,'offset'=>$pagesize,'order_by'=>'collect_time desc'),'esfbak');
$collect_array = $this->get_data(array('form_name' => 'personal_collection','where'=>array('uid'=>$uid,'kind'=>$kind,'city_name'=>$city),'limit'=>$pagesize,'offset'=>$offset,'order_by'=>'collect_time desc'),'esfbak');
$this->memcached_class->add($key, $collect_array,1);
}
......
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