Commit ff656646 authored by fangliyan's avatar fangliyan

Merge branch 'refs/heads/release' into subscribe2.0

parents c6fb0397 b9175ebb
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Esf_center_api extends MY_Controller { class Esf_center_api extends MY_Controller {
var $newrent_host = 'http://newrent.house365.com';
function __construct() function __construct()
{ {
...@@ -17,6 +18,13 @@ class Esf_center_api extends MY_Controller { ...@@ -17,6 +18,13 @@ class Esf_center_api extends MY_Controller {
$this->load->model('rent_coupon_model'); $this->load->model('rent_coupon_model');
$this->city = ''; $this->city = '';
$this->user_id = 0; $this->user_id = 0;
//根据ip是否是127开头判断是否是测试环境
if( substr($_SERVER['REMOTE_ADDR'],0,3) == '127' )
{
$this->newrent_host = 'http://newrentlocal.house365.com';
}
} }
...@@ -113,6 +121,25 @@ class Esf_center_api extends MY_Controller { ...@@ -113,6 +121,25 @@ class Esf_center_api extends MY_Controller {
$telno = $this->input->get('telno'); $telno = $this->input->get('telno');
$uid = $this->user_model->yztelno($telno); $uid = $this->user_model->yztelno($telno);
} }
$url = $this->newrent_host.'/api/tf-app-ext/add-house-collect';
$postData = array(
'house_id' => $this->input->get('rowid'),
'tbl' => $this->input->get('kind') == 3 ? 'sell' : 'rent',
'city' => $this->input->get('city'),
'uid' => $uid,
);
$result = SendDataByCurl($url,$postData);
$result = $result ? json_decode($result,true) : array();
$return = array('result' => 0,'msg' => '收藏失败');
if(!empty($result)){
$return['result'] = $result['code'] == 0 ? 1 : 0;
//utf8转gbk
$msg = $result['msg'] ? mb_convert_encoding($result['msg'], 'gbk', 'utf-8') : '';
$return['msg'] = $msg ? $msg : ($return['result'] == 1 ? '收藏成功' : '收藏失败');
}
echo serialize($return);
die();
$flag = $this->input->get('flag'); $flag = $this->input->get('flag');
if(empty($flag)) if(empty($flag))
{ {
......
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