Commit 161b2451 authored by fangliyan's avatar fangliyan

合并分支 'subscribe2.0' 到 'release'

小区收藏

查看合并请求 !40
parents f61534f9 0c0e58f5
...@@ -1289,36 +1289,56 @@ class Esf_center_api extends MY_Controller { ...@@ -1289,36 +1289,56 @@ class Esf_center_api extends MY_Controller {
$blockid = $this->input->get('id'); $blockid = $this->input->get('id');
$city = $this->input->get('city'); $city = $this->input->get('city');
$city = $city ? $city : 'nj'; $city = $city ? $city : 'nj';
$result = $this->user_model->getusercollectid($uid,$blockid,$city,$kind);
//已关注此房源 $url = $this->newrent_host.'/api/tf-app-ext/add-block-collect';
if( $result > 0 ) $postData = array(
{ 'bid' => $blockid,
$msg="已经收藏此小区"; 'city' => $city,
$return_array = array('result'=>'0','data'=>'2','msg'=>$msg); 'uid' => $uid,
echo serialize($return_array); );
}else{ $result = SendDataByCurl($url,$postData);
$url ="http://newrent.house365.com/server-task/agent-crm-insert-record?phone={$_GET['telno']}&city={$city}&activefrom=487&block_name=$blockid"; $result = $result ? json_decode($result,true) : array();
$ch = curl_init(); $return = array('result' => 0,'msg' => '收藏失败');
curl_setopt($ch, CURLOPT_URL, $url); if(!empty($result)){
curl_setopt($ch, CURLOPT_TIMEOUT, 1); $return['result'] = $result['code'] == 0 ? 1 : 0;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //utf8转gbk
curl_setopt($ch, CURLOPT_HEADER, 0); $msg = $result['msg'] ? mb_convert_encoding($result['msg'], 'gbk', 'utf-8') : '';
$rs = curl_exec($ch); $return['msg'] = $msg ? $msg : ($return['result'] == 1 ? '收藏成功' : '收藏失败');
curl_close($ch);
} }
echo serialize($return);
die();
$blockinfo = $this->user_model->get_data(array('form_name' => 'block','where'=>array('id'=>$blockid,'esta'=>'2'),'limit'=>1),'esfhousebak');
$searchcond = serialize($blockinfo[0]);
$this->user_model->addcollect($uid,$blockid,$kind,$searchcond,$city,2);
$msg="收藏成功";
//收藏成功,调用接口刷新 // $result = $this->user_model->getusercollectid($uid,$blockid,$city,$kind);
$url = 'http://newrent.house365.com/api/tf-app/refresh-block-list?uid='.$uid.'&city='.$city.'&id='.$blockid; //
curl_get_contents($url); // //已关注此房源
$return_array = array('result'=>'1','data'=>'1','msg'=>$msg); // if( $result > 0 )
echo serialize($return_array); // {
// $msg="已经收藏此小区";
// $return_array = array('result'=>'0','data'=>'2','msg'=>$msg);
// echo serialize($return_array);
// }else{
// $url ="http://newrent.house365.com/server-task/agent-crm-insert-record?phone={$_GET['telno']}&city={$city}&activefrom=487&block_name=$blockid";
// $ch = curl_init();
// curl_setopt($ch, CURLOPT_URL, $url);
// curl_setopt($ch, CURLOPT_TIMEOUT, 1);
// curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
// curl_setopt($ch, CURLOPT_HEADER, 0);
// $rs = curl_exec($ch);
// curl_close($ch);
// }
//
// $blockinfo = $this->user_model->get_data(array('form_name' => 'block','where'=>array('id'=>$blockid,'esta'=>'2'),'limit'=>1),'esfhousebak');
// $searchcond = serialize($blockinfo[0]);
// $this->user_model->addcollect($uid,$blockid,$kind,$searchcond,$city,2);
//
// $msg="收藏成功";
//
// //收藏成功,调用接口刷新
// $url = 'http://newrent.house365.com/api/tf-app/refresh-block-list?uid='.$uid.'&city='.$city.'&id='.$blockid;
// curl_get_contents($url);
// $return_array = array('result'=>'1','data'=>'1','msg'=>$msg);
// echo serialize($return_array);
} }
/** /**
......
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