Commit 6d82c466 authored by yanghui's avatar yanghui

Merge branch 'dev_yh' into release_dev

# Conflicts:
#	center/controllers/user_wang.php
parents b6f7b392 1db0e3f4
# Created by .ignore support plugin (hsz.mobi) # Created by .ignore support plugin (hsz.mobi)
.idea .idea
\ No newline at end of file
<?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))
{ {
...@@ -127,12 +154,15 @@ class Esf_center_api extends MY_Controller { ...@@ -127,12 +154,15 @@ class Esf_center_api extends MY_Controller {
$city = $this->input->get('city'); $city = $this->input->get('city');
$city = $city?$city:'nj'; $city = $city?$city:'nj';
$tbl=$kind==3?'sell':'rent'; $tbl=$kind==3?'sell':'rent';
$result = $this->user_model->getusercollectid($uid,$rowid,$city); if($uid){
//已关注此房源 $result = $this->user_model->getusercollectid($uid,$rowid,$city);
if($result['id']>0) //已关注此房源
{ if($result['id']>0)
$return = 'N_COL'; {
$return = 'N_COL';
}
} }
if($tbl == 'sell'){ if($tbl == 'sell'){
$houseinfo = $this->house_model->get_data(array('form_name' => $tbl,'where'=>array('id'=>$rowid,'esta'=>'1'),'select'=>array('infotype','infofrom','id','district','address','streetid','blockshowname','room','hall','buildarea','forward','fitment','buildyear','floor','totalfloor','subfloor','price','uid','telno','pic1','contactor','uid','averprice'),'limit'=>1),'esfhousebak'); $houseinfo = $this->house_model->get_data(array('form_name' => $tbl,'where'=>array('id'=>$rowid,'esta'=>'1'),'select'=>array('infotype','infofrom','id','district','address','streetid','blockshowname','room','hall','buildarea','forward','fitment','buildyear','floor','totalfloor','subfloor','price','uid','telno','pic1','contactor','uid','averprice'),'limit'=>1),'esfhousebak');
}else{ }else{
...@@ -289,6 +319,109 @@ class Esf_center_api extends MY_Controller { ...@@ -289,6 +319,109 @@ class Esf_center_api extends MY_Controller {
echo serialize($return_array); echo serialize($return_array);
} }
/**
* 关注房源操作接口,base_id版本
* @author fly
*/
public function save_house_focus_by_baseId()
{
$return ='';
$passport_uid = $this->input->get('passport_uid');
$uid=0;
$flag = $this->input->get('flag');
if($passport_uid){
//根据passport_uid获取uid
$uid = $this->user_model->getUidByPassportId($passport_uid);
if(empty($flag))
{
$flag = 2;
}
if($uid==0)
{
$return = 'N_USER';
}
}
$kind = $this->input->get('kind');
$rowid = $this->input->get('rowid');
$city = $this->input->get('city');
$phone = $this->input->get('phone');
$base_id = $this->input->get('base_id');
$city = $city?$city:'nj';
$tbl=$kind==3?'sell':'rent';
$result = $this->user_model->getCollectHouseIdByBaseID($base_id,$kind,$rowid,$city);
//已关注此房源
if($result['id']>0)
{
$return = 'N_COL';
}
if($tbl == 'sell'){
$houseinfo = $this->house_model->get_data(array('form_name' => $tbl,'where'=>array('id'=>$rowid,'esta'=>'1'),'select'=>array('infotype','infofrom','id','district','address','streetid','blockshowname','room','hall','buildarea','forward','fitment','buildyear','floor','totalfloor','subfloor','price','uid','telno','pic1','contactor','uid'),'limit'=>1),'esfhousebak');
}else{
$houseinfo = $this->house_model->get_data(array('form_name' => $tbl,'where'=>array('id'=>$rowid,'esta'=>'1'),'select'=>array('infotype','infofrom','id','district','address','streetid','blockshowname','room','hall','buildarea','forward','fitment','buildyear','floor','totalfloor','subfloor','price','uid','telno','pic1','contactor','uid','priceunit','renttype'),'limit'=>1),'esfhousebak');
}
if(empty($houseinfo[0]) && $city=='nj')
{
$return = 'N_HOU';
}elseif($return != 'N_COL'){
if(!empty($houseinfo[0]))
{
$searchcond = serialize($houseinfo[0]);
}else{
$searchcond = '';
}
$return = $this->user_model->addcollectByBaseID($base_id,$rowid,$kind,$searchcond,$city,$flag,$passport_uid,$uid);
}
if($return == 'N_COL'){
$result = 2;
$msg = '已收藏此房源';
}elseif($return == 'N_HOU'){
$result = 3;
$msg = '无此房源';
}elseif($return == 'N_USER'){
$result = 4;
$msg = '无此用户';
}elseif($return > 0){
$result = 1;
$msg = '收藏成功';
$house_type = $houseinfo[0]['room']."室".$houseinfo[0]['hall']."厅";
$houseinfo[0]['floor'] = iconv('gbk','utf-8',$houseinfo[0]['floor']);
$houseinfo[0]['blockshowname'] = iconv('gbk','utf-8',$houseinfo[0]['blockshowname']);
$houseinfo[0]['forward'] = iconv('gbk','utf-8',$houseinfo[0]['forward']);
$house_type = iconv('gbk','utf-8',$house_type);
if($kind==3){
$url ="http://crm.house365.com/index.php/Simulate/sea_utf8?mobile={$phone}&city={$city}&activefrom=485&my_floor={$houseinfo[0]['floor']}&total_floor={$houseinfo[0]['totalfloor']}&block_name={$houseinfo[0]['blockshowname']}&area={$houseinfo[0]['buildarea']}&forward={$houseinfo[0]['forward']}&buy_old_property={$houseinfo[0]['infotype']}&house_type={$house_type}";
$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);
}
//验证不在白名单,不在推送库,不在推送历史库
$result2 = $this->push_model->yzpush($telno);
if($result2<=0 && $city=='nj'){
//加入备选库
//$this->push_model->addalternatives($uid,$telno);
}
}elseif($return == 0){
$result = 0;
$msg = '收藏失败';
}
$return_array = array('result'=>$result,'msg'=>$msg);
echo serialize($return_array);
}
...@@ -758,6 +891,66 @@ class Esf_center_api extends MY_Controller { ...@@ -758,6 +891,66 @@ class Esf_center_api extends MY_Controller {
echo serialize($return_array); echo serialize($return_array);
} }
/**
* 根据用户中心base_id取消关注房源操作接口
* @author cxf
*/
public function api_cancel_focus_by_baseId()
{
$base_id = $this->input->get('base_id');
$kind = $this->input->get('kind');
$rowid = $this->input->get('rowid');
$city = $this->input->get('city');
$tbl=$kind==3?'sell':'rent';
$id = $this->user_model->getCollectHouseIdByBaseID($base_id,$kind,$rowid,$city,1);
if(empty($id))
{
$return = 'N_COL';
}else{
$return = $this->user_model->delcollect($id);
}
$result = 0;
$msg = '取消失败';
if($return == 'N_COL'){
//$result = 2;
//$msg = '无此收藏';
$result = 1;
$msg = '删除成功';
}elseif($return == 'N_USER'){
$result = 3;
$msg = '无此用户';
}elseif($return > 0){
$result = 1;
$msg = '删除成功';
}elseif($return == 0){
$result = 0;
$msg = '取消失败';
}
$return_array = array('result'=>$result,'msg'=>$msg);
echo serialize($return_array);
}
/**
* 根据base_id获取收藏状态
* @author fly
*/
public function get_focus_status_by_baseId()
{
$base_id = $this->input->get('base_id');
$kind = $this->input->get('kind');
$rowid = $this->input->get('rowid');
$city = $this->input->get('city');
$city = $city?$city:'nj';
$result = $this->user_model->getCollectHouseIdByBaseID($base_id,$kind,$rowid,$city);
$return_array = array('result'=>0,'msg'=>'未收藏');
if(!empty($result))
{
$return_array = array('result'=>1,'msg'=>'已收藏');
}
echo serialize($return_array);
}
/** /**
...@@ -926,6 +1119,49 @@ class Esf_center_api extends MY_Controller { ...@@ -926,6 +1119,49 @@ class Esf_center_api extends MY_Controller {
echo serialize($arr); 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接口 * 获得用户id接口
...@@ -1015,46 +1251,94 @@ class Esf_center_api extends MY_Controller { ...@@ -1015,46 +1251,94 @@ class Esf_center_api extends MY_Controller {
} }
/** /**
* app关注小区操作接口 * 关注小区操作接口
* @author cxf * @author cxf
*/ */
public function api_app_saveblock() public function api_saveblock_baseid()
{ {
$uid = $this->input->get('uid'); $base_id = $this->input->get('base_id');
$kind = $this->input->get('kind'); $kind = 2;
$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); $result = $this->user_model->getCollectHouseIdByBaseID($base_id,$kind,$blockid,$city);
//已关注此房源 //已关注此
if( $result > 0 ) if($result['id']>0)
{ {
$msg="已经收藏此小区"; echo "2";
$return_array = array('result'=>'0','data'=>'2','msg'=>$msg); exit;
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'); $blockinfo = $this->user_model->get_data(array('form_name' => 'block','where'=>array('id'=>$blockid,'esta'=>'2'),'limit'=>1),'esfhousebak');
$searchcond = serialize($blockinfo[0]); $searchcond = serialize($blockinfo[0]);
$this->user_model->addcollect($uid,$blockid,$kind,$searchcond,$city,2); $this->user_model->addcollectByBaseID($base_id,$blockid,$kind,$searchcond,$city);
$msg="收藏成功"; echo "1";
exit;
}
//收藏成功,调用接口刷新 /**
$url = 'http://newrent.house365.com/api/tf-app/refresh-block-list?uid='.$uid.'&city='.$city.'&id='.$blockid; * app关注小区操作接口
curl_get_contents($url); * @author cxf
$return_array = array('result'=>'1','data'=>'1','msg'=>$msg); */
echo serialize($return_array); public function api_app_saveblock()
{
$uid = $this->input->get('uid');
$kind = $this->input->get('kind');
$blockid = $this->input->get('id');
$city = $this->input->get('city');
$city = $city ? $city : 'nj';
$url = $this->newrent_host.'/api/tf-app-ext/add-block-collect';
$postData = array(
'bid' => $blockid,
'city' => $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();
// $result = $this->user_model->getusercollectid($uid,$blockid,$city,$kind);
//
// //已关注此房源
// if( $result > 0 )
// {
// $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);
} }
/** /**
...@@ -1375,7 +1659,7 @@ class Esf_center_api extends MY_Controller { ...@@ -1375,7 +1659,7 @@ class Esf_center_api extends MY_Controller {
$result = 1; $result = 1;
$msg = '停用'; $msg = '停用';
$return_array = array('result'=>$result , 'msg'=>$msg); $return_array = array('result'=>$result , 'msg'=>$msg);
echo serialize($return_array); echo serialize($return_array);die();
$telno = $this->input->get('telno'); $telno = $this->input->get('telno');
$paasword = $this->input->get('paasword'); $paasword = $this->input->get('paasword');
...@@ -2919,12 +3203,13 @@ class Esf_center_api extends MY_Controller { ...@@ -2919,12 +3203,13 @@ class Esf_center_api extends MY_Controller {
public function notify(){ public function notify(){
$data = $_POST; $data = $_POST;
$msg = "************************************************ \n"; $this->user_model->addLog("微信支付回调参数数据2:", json_encode( $data ) );
$msg .= date('Y-m-d H:i:s').var_export($_POST,true)." \n"; // $msg = "************************************************ \n";
$log = dirname(__FILE__)."/notify"; // $msg .= date('Y-m-d H:i:s').var_export($_POST,true)." \n";
file_put_contents($log,$msg,FILE_APPEND ); // $log = dirname(__FILE__)."/notify";
$log2 = dirname(__FILE__ ) . "/notifylog2.txt"; // file_put_contents($log,$msg,FILE_APPEND );
file_put_contents( $log2, $msg,FILE_APPEND ); // $log2 = dirname(__FILE__ ) . "/notifylog2.txt";
// file_put_contents( $log2, $msg,FILE_APPEND );
$result['status'] = 'FAIL'; $result['status'] = 'FAIL';
if(GB_CITY != 'nj' && GB_CITY != 'wh' ){ if(GB_CITY != 'nj' && GB_CITY != 'wh' ){
$result['msg'] = 'city error'; $result['msg'] = 'city error';
...@@ -2991,6 +3276,56 @@ class Esf_center_api extends MY_Controller { ...@@ -2991,6 +3276,56 @@ class Esf_center_api extends MY_Controller {
} }
} }
/**
* 0元支付回调
*/
public function zeroNotify() {
$result['status'] = 0;
$data = $_POST;
$transactionId = isset( $data['transaction_id'] ) ? $data['transaction_id'] : '';
// 订单数据
$orderInfo = $this->package_model->getOrderInfoByTransactionId( $transactionId );
if ( empty( $orderInfo ) ) {
$result['msg'] = '订单数据不存在';
echo json_encode($result);exit;
}
//判断订单状态
if($orderInfo['order_status'] != 1){
$result['msg'] = '订单已关闭';
echo json_encode($result);exit;
}
if($orderInfo['pay_status'] != 0){
$result['msg'] = '订单已失效';
echo json_encode($result);exit;
}
$payTransactionId = isset( $data['pay_transaction_id'] ) ? $data['pay_transaction_id'] : '';
if ( empty( $payTransactionId ) ) {
$result['msg'] = '支付凭证不能为空';
echo json_encode($result);exit;
}
//支付成功后的操作
$res = $this->package_model->payFinish( $orderInfo, array( 'transaction_id' => $payTransactionId ) );
if( !$res ) {
$result['msg'] = '生成推广相关数据失败';
echo json_encode($result);exit;
}
// 发送短信
if ( GB_CITY == 'nj' ) {
$this->sendMsg( $orderInfo );
}
$result['status'] = 1;
$result['msg'] = '成功';
echo json_encode($result);exit;
}
// 支付回调修复数据 20200605 // 支付回调修复数据 20200605
public function notify_modify_data(){ public function notify_modify_data(){
$data = $_POST; $data = $_POST;
...@@ -3196,4 +3531,18 @@ class Esf_center_api extends MY_Controller { ...@@ -3196,4 +3531,18 @@ class Esf_center_api extends MY_Controller {
return true; return true;
} }
public function test(){
$transactionId = $_GET['trans_id'];
if(!$transactionId){
echo 'error';exit;
}
$this->load->model("package_model");
$orderInfo = $this->package_model->getOrderInfoByTransactionId($transactionId);
if(empty($orderInfo)){
echo 'no order';exit;
}
$this->sendMsg($orderInfo);
echo 'ok';exit;
}
} }
\ No newline at end of file
...@@ -570,19 +570,19 @@ class Esf_center_api_zhang extends MY_Controller { ...@@ -570,19 +570,19 @@ class Esf_center_api_zhang extends MY_Controller {
//登陆成功需要把sso_token以cookie形式种到浏览器中 //登陆成功需要把sso_token以cookie形式种到浏览器中
protected function register_tf_ucenter_cookie($passport_uid){ protected function register_tf_ucenter_cookie($passport_uid){
setcookie('PHPSESSID','',time()-1,'/','house365.com'); // setcookie('PHPSESSID','',time()-1,'/','house365.com');
$url = "http://api.house365.com/passport/passport_gettoken_byuid.php?passport_uid=".$passport_uid; // $url = "http://api.house365.com/passport/passport_gettoken_byuid.php?passport_uid=".$passport_uid;
if(isset($_COOKIE['utm_source']) && isset($_COOKIE['utm_medium']) && isset($_COOKIE['utm_campaign'])){ // if(isset($_COOKIE['utm_source']) && isset($_COOKIE['utm_medium']) && isset($_COOKIE['utm_campaign'])){
$url.= "&utm_source={$_COOKIE['utm_source']}&utm_medium={$_COOKIE['utm_medium']}&utm_campaign={$_COOKIE['utm_campaign']}"; // $url.= "&utm_source={$_COOKIE['utm_source']}&utm_medium={$_COOKIE['utm_medium']}&utm_campaign={$_COOKIE['utm_campaign']}";
} // }
if(isset($_COOKIE['crm_scene'])){ // if(isset($_COOKIE['crm_scene'])){
$url.= "&register_client=PC&register_application={$_COOKIE['crm_scene']}"; // $url.= "&register_client=PC&register_application={$_COOKIE['crm_scene']}";
} // }
$api_res = json_decode($this->get_api($url), true); // $api_res = json_decode($this->get_api($url), true);
//
if(isset($api_res['result']) && $api_res['result']==1){ // if(isset($api_res['result']) && $api_res['result']==1){
setcookie('sso_token',$api_res['data'],time()+3600*24*180,'/','house365.com'); // setcookie('sso_token',$api_res['data'],time()+3600*24*180,'/','house365.com');
} // }
} }
......
...@@ -17,6 +17,8 @@ class Findpassword extends MY_Controller { ...@@ -17,6 +17,8 @@ class Findpassword extends MY_Controller {
*/ */
public function index() public function index()
{ {
header('Location:http://passport.house365.com/index/forgetPwd');die();
$_SESSION['token'] = md5($this->user_id); $_SESSION['token'] = md5($this->user_id);
$data['title'] = '用户找回密码'; $data['title'] = '用户找回密码';
......
...@@ -17,7 +17,7 @@ class Login extends MY_Controller ...@@ -17,7 +17,7 @@ class Login extends MY_Controller
function index() function index()
{ {
Header("HTTP/1.1 301 Moved Permanently"); Header("HTTP/1.1 301 Moved Permanently");
Header("Location: http://newrent.house365.com/user/login"); Header("Location: http://passport.house365.com/index/login?others_returnback=http://newrent.house365.com/user-center/index");
exit; exit;
//IM 埋点 //IM 埋点
if($_GET['from']=='im'){ if($_GET['from']=='im'){
......
...@@ -45,7 +45,7 @@ class User extends MY_Controller ...@@ -45,7 +45,7 @@ class User extends MY_Controller
); );
private $address = array( private $address = array(
'nj' => '南京市建邺区云龙山路99号江苏省建大厦B幢6楼信息中心;(地铁10号线中胜站下2A出口,向东300米)', 'nj' => '南京市雨花台区花神大道90号中兴物联研发大楼3号楼4楼房源审核部。(地铁1号线软件大道站2号出口,步行363米)',
'wh' => '芜湖市镜湖区绿地新都会C座7层 365淘房二手房运营部', 'wh' => '芜湖市镜湖区绿地新都会C座7层 365淘房二手房运营部',
); );
...@@ -544,6 +544,11 @@ class User extends MY_Controller ...@@ -544,6 +544,11 @@ class User extends MY_Controller
echo $result;exit; echo $result;exit;
} }
if(isset($_GET['zj']) && $_GET['zj']==1)
{
var_dump($house);die();
}
//分页开始 //分页开始
$data['collect_num'] = $this->num_5; $data['collect_num'] = $this->num_5;
$data['pagesize'] = 5;//设定每一页显示的记录数 $data['pagesize'] = 5;//设定每一页显示的记录数
...@@ -552,7 +557,7 @@ class User extends MY_Controller ...@@ -552,7 +557,7 @@ class User extends MY_Controller
$data['page'] = ($data['page']>$data['pages'] && $data['pages']!=0) ? $data['pages'] : $data['page']; //判断跳转页数 $data['page'] = ($data['page']>$data['pages'] && $data['pages']!=0) ? $data['pages'] : $data['page']; //判断跳转页数
$data['offset'] = $data['pagesize']*($data['page']-1); //计算记录偏移量 $data['offset'] = $data['pagesize']*($data['page']-1); //计算记录偏移量
$data['collect'] = $this->user_model->getcollect(5,$this->user_id,$data['offset'],$data['pagesize']); $data['collect'] = $this->user_model->getcollect(5,$this->user_id,$data['offset'],$data['pagesize']);
$data['sarr'] = $this->user_model->getSeachcondStr($data['collect']); $data['sarr'] = $this->user_model->getSeachcondStr($data['collect'], 'rent');
$data['surl'] = $this->user_model->getSeachcondUrl($data['collect'], 5); $data['surl'] = $this->user_model->getSeachcondUrl($data['collect'], 5);
//获取你可能感兴趣的租房 //获取你可能感兴趣的租房
$data['likerent'] = $this->user_model->getlikehouse($this->user_id,'rent',4); $data['likerent'] = $this->user_model->getlikehouse($this->user_id,'rent',4);
...@@ -1814,8 +1819,10 @@ class User extends MY_Controller ...@@ -1814,8 +1819,10 @@ class User extends MY_Controller
$packageKeyword = intval($this->input->post('package_keyword',true)); $packageKeyword = intval($this->input->post('package_keyword',true));
$day = intval($this->input->post('day_'.$packageType,true)); $day = intval($this->input->post('day_'.$packageType,true));
$payType = addslashes($this->input->post('pay_type',true)); $payType = addslashes($this->input->post('pay_type',true));
// 租房8折优惠券 20200507添加 // 是否使用优惠券
$use_coupon = intval($this->input->post('use_coupon',true)); $use_coupon = intval($this->input->post('use_coupon',true));
// 优惠券ID
$coupon_id = intval($this->input->post('coupon_id',true));
$from_url = $this->input->post('from_url',true); $from_url = $this->input->post('from_url',true);
if(empty($packageId) || empty($houseId) || empty($tbl) || empty($packageType) || (!in_array($packageType,array(4,5)) && empty($day)) || empty($payType) || !in_array($payType,$payTypeArr)){ if(empty($packageId) || empty($houseId) || empty($tbl) || empty($packageType) || (!in_array($packageType,array(4,5)) && empty($day)) || empty($payType) || !in_array($payType,$payTypeArr)){
return $this->jump(USER_CENTER,'参数缺失',3000,'warning'); return $this->jump(USER_CENTER,'参数缺失',3000,'warning');
...@@ -1849,73 +1856,86 @@ class User extends MY_Controller ...@@ -1849,73 +1856,86 @@ class User extends MY_Controller
$packageData['package_desc'] = unserialize($packageData['package_desc']); $packageData['package_desc'] = unserialize($packageData['package_desc']);
foreach($packageData['package_desc'] as $item){ foreach($packageData['package_desc'] as $item){
if($packageType == 4){ if($packageType == 4){
$price = floatval($item['price']); $price = $originalPrice = floatval($item['price']);
}else if($packageType == 5){ }else if($packageType == 5){
if($item['property_type'] == $infoType){ if($item['property_type'] == $infoType){
$price = floatval($item['price']); $price = $originalPrice = floatval($item['price']);
//处理折扣 //处理折扣
if(isset($item['discount']) && $item['discount'] >0){ if(isset($item['discount']) && $item['discount'] >0){
$price = $this->pirceDiscount($price,$item['discount']); $price = $originalPrice = $this->pirceDiscount($price,$item['discount']);
} }
} }
}else{ }else{
if($item['property_type'] == $infoType && $item['day'] == $day){ if($item['property_type'] == $infoType && $item['day'] == $day){
$price = floatval($item['price']); $price = $originalPrice = floatval($item['price']);
//处理折扣
if(GB_CITY == 'wh' && $packageType == 2){ if(isset($item['discount']) && $item['discount'] >0){
//处理折扣 $price = $originalPrice = $this->pirceDiscount($price,$item['discount']);
if(isset($item['discount']) && $item['discount'] >0){
$price = $this->pirceDiscount($price,$item['discount']);
}
} }
// 列表套餐8折券使用 20200507 // 列表套餐8折券使用 20200507
// 优惠券修改为 6折 // 优惠券修改为 6折
if( GB_CITY == 'nj' && $packageType == 2 && $tbl == 'rent'){ // if( GB_CITY == 'nj' && $packageType == 2 && $tbl == 'rent'){
// // //
$checkbox_status = 0; // $checkbox_status = 0;
// 检查是否有可用的优惠券,如果有则使用,如果无,则跳转提示 // // 检查是否有可用的优惠券,如果有则使用,如果无,则跳转提示
$userInfoData = $this->user_model->getuserdetail($this->user_id); // $userInfoData = $this->user_model->getuserdetail($this->user_id);
$passport_uid = $userInfoData ? $userInfoData['passport_uid'] : 0; // $passport_uid = $userInfoData ? $userInfoData['passport_uid'] : 0;
//
// 测试数据 // // 测试数据
$couponUserIdArr = array('1785149','3367096','4112782'); // $couponUserIdArr = array('1785149','3367096','4112782');
if( in_array($this->user_id,$couponUserIdArr) ){ // if( in_array($this->user_id,$couponUserIdArr) ){
$price = 0.05; // $price = 0.05;
} // }
//
if( isset($use_coupon) && $use_coupon == 1){ // if( isset($use_coupon) && $use_coupon == 1){
//
$check_coupon = $this->rent_coupon_model->checkCoupon($passport_uid); // $check_coupon = $this->rent_coupon_model->checkCoupon($passport_uid);
if( !$check_coupon ){ // if( !$check_coupon ){
$from_url = $from_url ? $from_url : USER_CENTER; // $from_url = $from_url ? $from_url : USER_CENTER;
return $this->jumpNew($from_url,'已有待支付订单,勿重复下单!<br/>请30分钟后再试。',3000,'warning'); // return $this->jumpNew($from_url,'已有待支付订单,勿重复下单!<br/>请30分钟后再试。',3000,'warning');
} // }
$checkbox_status = 1; // $checkbox_status = 1;
// 列表优先套餐8折 // // 列表优先套餐8折
// 修改为6折 20200927 // // 修改为6折 20200927
$price = sprintf("%.2f",$price * 0.6); // $price = sprintf("%.2f",$price * 0.6);
// 锁定半小时 // // 锁定半小时
$this->rent_coupon_model->lockCoupon($passport_uid); // $this->rent_coupon_model->lockCoupon($passport_uid);
//
//
} // }
//
// 设置8折优惠券的选中状态 // // 设置8折优惠券的选中状态
$this->rent_coupon_model->setCheckbox($passport_uid,$checkbox_status); // $this->rent_coupon_model->setCheckbox($passport_uid,$checkbox_status);
//
// }
}
}
}
} // 使用优惠券
if ( GB_CITY == 'nj' ) {
if( isset( $use_coupon ) && $use_coupon == 1 ) {
$couponRes = $this->user_model->checkCoupon( $this->user_id, $coupon_id, $price, $packageType );
if ( isset( $couponRes['result'] ) && $couponRes['result'] == 1 ) {
$price = $price - $couponRes['data']['coupon_price'] ;
} }
} }
} }
$userIdArr = array(4112782,5355879,1729793,4449390); $userIdArr = array(4112782,5355879,1729793,4449390,6264549,6261067);
if(in_array($this->user_id,$userIdArr)){ if(in_array($this->user_id,$userIdArr)){
$price = 0.01; $price = $price * 0.01;
} }
// 付款方式
$payType = $price <= 0 ? 'zeroyuanpay' : $payType;
//校验参数正确性 //校验参数正确性
if($packageType != $packageData['package_type'] || empty($price) || $price <= 0){ // if($packageType != $packageData['package_type'] || empty($price) || $price <= 0){
return $this->jump(USER_CENTER,'套餐价格数据异常',3000,'warning'); // return $this->jump(USER_CENTER,'套餐价格数据异常',3000,'warning');
// }
if($packageType != $packageData['package_type']){
return $this->jump(USER_CENTER,'套餐数据异常',3000,'warning');
} }
if($packageType == 1 && ( $packageKeyword != $packageData['package_keyword'] || $packageKeyword <= 0 ) ){ if($packageType == 1 && ( $packageKeyword != $packageData['package_keyword'] || $packageKeyword <= 0 ) ){
return $this->jump(USER_CENTER,'套餐关键词异常',3000,'warning'); return $this->jump(USER_CENTER,'套餐关键词异常',3000,'warning');
...@@ -1973,7 +1993,7 @@ class User extends MY_Controller ...@@ -1973,7 +1993,7 @@ class User extends MY_Controller
$tblArr = array('sell' => 1 ,'rent' => 2); $tblArr = array('sell' => 1 ,'rent' => 2);
$tableId = $tblArr[$tbl]; $tableId = $tblArr[$tbl];
$orderData = array(); $orderData = array();
$orderData['transaction_id'] = $this->package_model->getTransactionId($packageType); $orderData['transaction_id'] = $this->package_model->getTransactionId( $packageType );
$orderData['user_id'] = $this->user_id; $orderData['user_id'] = $this->user_id;
$orderData['house_type'] = $tableId; $orderData['house_type'] = $tableId;
$orderData['house_id'] = $houseId; $orderData['house_id'] = $houseId;
...@@ -1983,6 +2003,12 @@ class User extends MY_Controller ...@@ -1983,6 +2003,12 @@ class User extends MY_Controller
if($packageType == 1){ if($packageType == 1){
$orderData['package_keyword'] = $packageKeyword; $orderData['package_keyword'] = $packageKeyword;
} }
// 优惠券字段
if ( isset( $couponRes['result'] ) && $couponRes['result'] == 1 ) {
$orderData['coupon_name'] = isset( $couponRes['data']['name'] ) ? iconv('utf-8','gbk',$couponRes['data']['name']) : 0;
$orderData['coupon_price'] = isset( $couponRes['data']['coupon_price'] ) ? $couponRes['data']['coupon_price'] : 0;
$orderData['coupon_id'] = isset( $couponRes['data']['id'] ) ? $couponRes['data']['id'] : 0;
}
$orderData['package_days'] = $day; $orderData['package_days'] = $day;
$orderData['price'] = $price; $orderData['price'] = $price;
$orderData['create_time'] = time(); $orderData['create_time'] = time();
...@@ -1996,6 +2022,26 @@ class User extends MY_Controller ...@@ -1996,6 +2022,26 @@ class User extends MY_Controller
return $this->jump(USER_CENTER ,'订单创建失败',3000,'warning'); return $this->jump(USER_CENTER ,'订单创建失败',3000,'warning');
} }
// 使用优惠券
if ( GB_CITY == 'nj' ){
if( isset( $use_coupon ) && $use_coupon == 1 ) {
$this->user_model->useCoupon( $orderData['transaction_id'], $this->user_id, $coupon_id, $originalPrice, $packageType );
// 0元支付
if ( $price <= 0 ) {
//支付成功后的操作
$result = $this->package_model->payFinish($orderData, array('transaction_id' => $this->package_model->getPaymentTransactionId( $packageType )));
if (GB_CITY == 'nj') {
$this->package_model->sendMsg( $orderData );
}
$data['orderData'] = $orderData;
$data['title'] = '0元支付';
$this->load->view('zero_yuan_pay', $data);
return;
}
}
}
$data = $this->getWxPayCodeByHouse365($orderId); $data = $this->getWxPayCodeByHouse365($orderId);
if($data['status'] != 1){ if($data['status'] != 1){
return $this->jump(USER_CENTER , $data['msg'],3000,'warning'); return $this->jump(USER_CENTER , $data['msg'],3000,'warning');
...@@ -2211,7 +2257,7 @@ class User extends MY_Controller ...@@ -2211,7 +2257,7 @@ class User extends MY_Controller
$data['orderData'] = $orderData; $data['orderData'] = $orderData;
$data['title'] = '发票在线填写'; $data['title'] = '发票在线填写';
$this->load->model("tel_model"); $this->load->model("tel_model");
$data['telno_config'] = $this->tel_model->getTelInfoByType(tel_model::TYPE3); $data['telno_config'] = $this->tel_model->getTelInfoByType(tel_model::TYPE2);
$data['address_config'] = isset($this->address[GB_CITY]) ? $this->address[GB_CITY] : ''; $data['address_config'] = isset($this->address[GB_CITY]) ? $this->address[GB_CITY] : '';
$this->load->view('order_invoice',$data); $this->load->view('order_invoice',$data);
...@@ -2359,19 +2405,22 @@ class User extends MY_Controller ...@@ -2359,19 +2405,22 @@ class User extends MY_Controller
$data['conf_where'] = 'myorder'; $data['conf_where'] = 'myorder';
$data['title'] = '我的订单'; $data['title'] = '我的订单';
$data['qrImg'] = $this->user_model->getBuyQrImg($this->user_id);
$data['pagesize'] = 10;//记录每页的条数 if(1==2) {
$data['page'] = $this->uri->segment(3) ? intval($this->uri->segment(3)) :1 ; // 获取当前页数 $data['pagesize'] = 10;//记录每页的条数
$data['page'] = $this->uri->segment(3) ? intval($this->uri->segment(3)) : 1; // 获取当前页数
$data['totalsize'] = $this->user_model->myorder_count($this->user_id);//记录总数 $data['totalsize'] = $this->user_model->myorder_count($this->user_id);//记录总数
$data['totalpage'] = ceil($data['totalsize']/$data['pagesize']); $data['totalpage'] = ceil($data['totalsize'] / $data['pagesize']);
$orderdata = $this->user_model->myorder_list($this->user_id,$data['page'],$data['pagesize']); $orderdata = $this->user_model->myorder_list($this->user_id, $data['page'], $data['pagesize']);
$invoiceUrlArr = $this->user_model->getInvoiceUrlArr( $orderdata ); $invoiceUrlArr = $this->user_model->getInvoiceUrlArr($orderdata);
$data['orders'] = $orderdata; $data['orders'] = $orderdata;
$data['invoice_url_arr'] = $invoiceUrlArr; $data['invoice_url_arr'] = $invoiceUrlArr;
}
$this->load->view('myorder',$data); $this->load->view('myorder',$data);
} }
......
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class User extends MY_Controller
{
/**
* Survey
* @author Candison <www.kandisheng.com>
*/
private $surveyConfig = array(
'nj' => array(
'surveyInfotype' => array(1,'1'),
'surveyDistrict' => array('雨花台区'),
),
'wh' => array(
'surveyInfotype' => array(1,2,3,4,5,6,'1','2','3','4','5','6'),
'surveyDistrict' => array('镜湖区', '鸠江区', '弋江区', '三山区'),
),
);
/**
* 开通支付的城市
* @var array
*/
private $openPayCitys = array(
'nj','wh'
);
/**
* 支付中台活动id
* @var array
*/
private $openPayCitysActId = array(
'nj' => 57,
'wh' => 82,
);
private $surveyStatus = array(
0 => '实勘未知状态',
1 => '实勘审核中',
2 => '实勘不通过',
3 => '实勘已预约',
4 => '实勘处理中',
5 => '实勘已上传',
6 => '实勘已取消'
);
private $address = array(
'nj' => '南京市建邺区云龙山路99号江苏省建大厦B幢6楼信息中心;(地铁10号线中胜站下2A出口,向东300米',
'wh' => '芜湖市镜湖区绿地新都会C座7层 365淘房二手房运营部',
);
function __construct()
{
parent::__construct();
$this->load->model("user_model");
$this->load->model("broker_model");
$this->load->model("pic_model");
$this->load->model("block_model");
$this->load->model("ask_model");
$this->load->model("house_model");
$this->load->model("house_statistic_model");
// 租房9折优惠券 20200507添加
$this->load->model('rent_coupon_model');
$this->load->library("user_class");
$this->load->library("apply_class");
$this->user_id = checklogin();
if( $this->user_id <= 0 )
{
jumpto( USER_CENTER.'login');
exit();
}
//关注各项数量
$this->num_1 = $this->user_model->getusercollect($this->user_id,1);
$this->num_2 = $this->user_model->getusercollect($this->user_id,2);
$this->num_3 = $this->user_model->getusercollect($this->user_id,3);
$this->num_4 = $this->user_model->getusercollect($this->user_id,4);
$this->num_5 = $this->user_model->getusercollect($this->user_id,5);
$this->num_7 = $this->user_model->getusercollect($this->user_id,7);
}
private function getAD($id=0, $width=0, $height=0)
{
/*
$databaseHost = '172.17.1.5';
$databasePort = '3306';
$databaseName = 'njhouse';
$databaseAccount = 'root';
$databasePassword = 'idontcare';
$databaseCharset = 'gbk';
// Connect
$mysql = mysql_connect(sprintf('%s:%s', $databaseHost, $databasePort), $databaseAccount, $databasePassword);
if($mysql === false){
return $defaultString;
}
// Query
$sql = sprintf('select id,filetype,width,height,href,src from news_ad where id="%s" limit 1', $id);
$result = mysql_db_query($databaseName, $sql, $mysql);
if($result === false){
return $defaultString;
}
$data = mysql_fetch_row($result);
if($data === false){
return $defaultString;
}
*/
// Config
$defaultString = '';
$adInterfaceBaseURL = 'http://adadmin.house365.com/api/ad/sort_ads.php';
// Get Data
$adInterfaceURL = sprintf('%s?city=%s&id=%s', $adInterfaceBaseURL, GB_CITY, $id);
$result = curl_get_contents($adInterfaceURL);
if(empty($result)){
return $defaultString;
}
$data = unserialize($result);
if(!isset($data[0])){
return $defaultString;
}
$data = $data[0];
// HTML
if(intval($width) == 0 && intval($height) == 0){
$width = $data['width'];
$height = $data['height'];
}
if($data['filetype'] == 'i'){
if(empty($data['href'])){
return sprintf('<img target="_blank" src="%s" width="%s" height="%s" border="0">', $data['src'], $width, $height);
}
return sprintf('<a target="_blank" href="%s"><img target="_blank" src="%s" width="%s" height="%s" border="0"></a>', $data['link'], $data['src'], $width, $height);
}
if($data['filetype'] == 'f'){
return sprintf('<embed src="%s" quality="high" width="%s" height="%s" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent">', $data['src'], $width, $height);
}
return $defaultString;
}
/**
* 用户中心首页
* @author cxf
*/
public function index()
{
global $house;
header("Location:http://newrent.house365.com/user-center/index");
die;
$data['conf_where'] = 'index';
$data['title'] = '会员中心';
$data['priceunit'] = $house['priceunit'];
$data['sell_num'] = $this->house_model->gethousenumbyuid($this->user_id,'sell',1);
$data['rent_num'] = $this->house_model->gethousenumbyuid($this->user_id,'rent',1);
$data['want_num'] = $this->user_model->get_rent_wantnum_by_uid($this->user_id,1);
$data['buy_num'] = $this->user_model->get_buynum_by_uid($this->user_id,1);
$data['user_detail'] = $this->user_model->get_userdetail($this->user_id,array('email','telno','auth_type','bank_type'));
$data = array_merge($data,$this->realNameData());
//获取最新2条房源
$newhouse = $this->user_model->newhouse( $this->user_id , 2 );
$data['newhouse'] = $newhouse;
$count_newhouse =count($newhouse);
$active_num =0;
$active_sell_num =0;
for($i=0;$i<$count_newhouse;$i++)
{
if($newhouse[$i]['esta']==1)
{
if($newhouse[$i]['tbl']=='sell')
{
$active_sell_num++;
}
$active_num++;
}
}
$sell_collect_house = $this->user_model->getcollect(3,$this->user_id,0,8); //网友关注的二手房房源
$rent_collect_house = $this->user_model->getcollect(4,$this->user_id,0,8); //网友关注的租房房源
$sell_collect_block = $this->user_model->getcollect(2,$this->user_id,0,8); //网友关注的小区
$data['sell_collect_house'] = $sell_collect_house;
$data['rent_collect_house'] = $rent_collect_house;
$data['sell_collect_block'] = $sell_collect_block;
//获取你可能感兴趣的二手房
$data['likesell'] = $this->user_model->getlikehousebyrule($active_num,$active_sell_num,$newhouse,$sell_collect_house,$sell_collect_block,$this->user_id,'sell',$active_sell_num,4);
//获取你可能感兴趣的租房
$data['likerent'] = $this->user_model->getlikehousebyrule($active_num,$active_sell_num,$newhouse,$rent_collect_house,$sell_collect_block,$this->user_id,'rent',$active_sell_num,4);
//获取你可能感兴趣的小区
$data['likeblock'] = $this->user_model->getlikehousebyrule($active_num,$active_sell_num,$newhouse,$sell_collect_house,$sell_collect_block,$this->user_id,'block',4);
//中奖通知 5.25-8.31
$data['is_win'] = $this->_get_is_win();
//BI统计 ----- start----->
$data['isa_website'] = '2,19,46';
$data['isa_city'] = GB_CITY;
$data['isa_addones'] = '';
$data['isa_url'] = 'isa.house365.com/js/analyze.js?v=2.1';
$this->load->model('package_model');
$data['limitNumGtZero'] = $this->package_model->getLimitNumGtZero();
//BI统计 ----- ent----->
/**
* Survey
* @author Candison <www.kandisheng.com>
*/
if (is_array($data['newhouse'])) {
if(GB_CITY=='nj'){
$this->load->model('survey_model');
$modelSurvey = new Survey_model();
}elseif(GB_CITY == 'wh'){
$this->load->model('vr_model');
$modelSurvey = new Vr_model();
}
foreach($data['newhouse'] as &$value) {
$value['survey_status'] = '';
$value['can_survey'] = false;
$value['show_survey_icon'] = false;
if(intval($value['esta']) != 1){
$value['survey'] = 0;
}
if ($value['tbl'] == 'sell' && $data['limitNumGtZero'][5]['sell'] && intval($value['survey']) != 1 && intval($value['esta']) == 1 && in_array(GB_CITY, array_keys($this->surveyConfig)) && in_array(intval($value['infotype']), $this->surveyConfig[GB_CITY]['surveyInfotype']) && in_array($value['district'], $this->surveyConfig[GB_CITY]['surveyDistrict'])) {
$value['can_survey'] = true;
}
if(intval($value['survey']) == 1) {
if(GB_CITY=='nj'){
$surveyInformation = $modelSurvey->getInformation('sell', $value['id']);
$status = isset($surveyInformation[0]['status']) ? intval($surveyInformation[0]['status']) : 0;
if ($status == 3 && !empty($surveyInformation[0]['time_order']) && time() > intval($surveyInformation[0]['time_order'])) {
$status = 4;
}
if($status != 2){
$value['show_survey_icon'] = true;
}
$value['survey_status'] = isset($this->surveyStatus[$status]) ? $this->surveyStatus[$status] : '实勘未知状态';
}elseif(GB_CITY=='wh'){
$surveyInformation = $modelSurvey->getVrInfoByHouseId('sell', $value['id']);
if($surveyInformation){
$value['show_survey_icon'] = $surveyInformation['show_icon'];
$value['survey_status'] = $surveyInformation['vr_status_word'];
}
}
}
//获取房源已有套餐
if(in_array(GB_CITY,$this->openPayCitys)){
$packageData = $this->package_model->getHousePackageNew($value['id'],$value['tbl']);
if($packageData){
if(isset($packageData['leftTime'])) $value['leftTime'] = $packageData['leftTime'];
if(in_array(1,$packageData['package_types']) || in_array(2,$packageData['package_types']) || in_array(3,$packageData['package_types'])){
$value['promoting'] = 1;
}else{
$value['promoting'] = 0;
}
}
}
}
}
$data['ad3799'] = $this->getAD(3799);
$data['ad4217'] = $this->getAD(4217);
$this->load->view('index',$data);
}
/**
* 会员中心切换城市
* @author cxf
*/
public function changecity()
{
$city = $this->input->get('city');
$city = !empty($city)?$city:'nj';
header("Location:http://newrent.house365.com/user-center/switch-city?city=".$city);
die;
setcoandsess('website_jumpto_city',$city);
jumpto(USER_CENTER.'user');
}
/**
* 我的关注二手房页面
* @author cxf
*/
public function selllist()
{
$data['conf_where'] = 'selllist';
$data['title'] = '会员中心';
//删除操作
if(isset($_POST['muldel']) && $_POST['muldel']=='del')
{
$result = $this->user_model->delcollect($_POST['actionid']);
echo $result;exit;
}
//分页开始
$data['collect_num'] = $this->num_3;
$data['pagesize'] = 8;//设定每一页显示的记录数
$data['pages'] = $data['collect_num'] ? ceil($data['collect_num']/$data['pagesize']) : 0 ; //计算总页数
$data['page'] = $this->uri->segment(3) ? intval($this->uri->segment(3)) :1 ; // 获取当前页数
$data['page'] = ($data['page']>$data['pages'] && $data['pages']!=0) ? $data['pages'] : $data['page']; //判断跳转页数
$data['offset'] = $data['pagesize']*($data['page']-1); //计算记录偏移量
$data['collect'] = $this->user_model->getcollect(3,$this->user_id,$data['offset'],$data['pagesize']);
if(is_array($data['collect'])&&!empty($data['collect'])){
foreach($data['collect'] as $key=>$value){
if(GB_CITY=='nj')
{
$isChoice = $this->user_model->isCheckPriceRemind($this->user_id,$value['collect_id']);
$infofrom_data=$this->user_model->get_infofrom_by_id($value['collect_id']);
}
$data['collect'][$key]['infofrom'] =$infofrom_data[0]['infofrom'];
$data['collect'][$key]['is_remind'] = isset($isChoice[0]['status'])&&($isChoice[0]['status']==1) ? 1:0;
}
}
//获取你可能感兴趣的二手房
$data['likesell'] = $this->user_model->getlikehouse($this->user_id,'sell',4);
//BI统计 ----- start----->
$data['isa_website'] = '2,19,79';
$data['isa_city'] = GB_CITY;
$data['isa_addones'] = '';
$data['isa_url'] = 'isa.house365.com/js/analyze.js?v=2.1';
//BI统计 ----- ent----->
$this->load->view('my_attention_sell',$data);
}
/**
* 我的关注租房页面
* @author cxf
*/
public function rentlist()
{
GLOBAL $house;
$data['conf_where'] = 'selllist';
$data['title'] = '我的关注';
//删除操作
if(isset($_POST['muldel']) && $_POST['muldel']=='del')
{
$result = $this->user_model->delcollect($_POST['actionid']);
echo $result;exit;
}
//分页开始
$data['collect_num'] = $this->num_4;
$data['pagesize'] = 8;//设定每一页显示的记录数
$data['pages'] = $data['collect_num'] ? ceil($data['collect_num']/$data['pagesize']) : 0 ; //计算总页数
$data['page'] = $this->uri->segment(3) ? intval($this->uri->segment(3)) :1 ; // 获取当前页数
$data['page'] = ($data['page']>$data['pages'] && $data['pages']!=0) ? $data['pages'] : $data['page']; //判断跳转页数
$data['offset'] = $data['pagesize']*($data['page']-1); //计算记录偏移量
$data['collect'] = $this->user_model->getcollect(4,$this->user_id,$data['offset'],$data['pagesize']);
$data['priceunit'] = $house['priceunit'];
//获取你可能感兴趣的租房
$data['likerent'] = $this->user_model->getlikehouse($this->user_id,'rent',4);
$this->load->view('my_attention_rent',$data);
}
/**
* 我的关注小区页面
* @author cxf
*/
public function blocklist()
{
$data['conf_where'] = 'blocklist';
$data['title'] = '我的关注';
//删除操作
if(isset($_POST['muldel']) && $_POST['muldel']=='del')
{
$result = $this->user_model->delcollect($_POST['actionid']);
echo $result;
exit;
}
//分页开始
$data['collect_num'] = $this->num_2;
$data['pagesize'] = 8;//设定每一页显示的记录数
$data['pages'] = $data['collect_num'] ? ceil($data['collect_num']/$data['pagesize']) : 0 ; //计算总页数
$data['page'] = $this->uri->segment(3) ? intval($this->uri->segment(3)) :1 ; // 获取当前页数
$data['page'] = ($data['page']>$data['pages'] && $data['pages']!=0) ? $data['pages'] : $data['page']; //判断跳转页数
$data['offset'] = $data['pagesize']*($data['page']-1); //计算记录偏移量
$data['collect'] = $this->user_model->getcollect(2,$this->user_id,$data['offset'],$data['pagesize']);
//获取你可能感兴趣的小区
$data['likeblock'] = $this->user_model->getlikehouse($this->user_id,'block',4);
//BI统计 ----- start----->
$data['isa_website'] = '2,19,80';
$data['isa_city'] = GB_CITY;
$data['isa_addones'] = '';
$data['isa_url'] = 'isa.house365.com/js/analyze.js?v=2.1';
//BI统计 ----- ent----->
$this->load->view('my_attention_block',$data);
}
/**
* 我的关注学区页面
* @author xue
*/
public function schoollist()
{
$data['conf_where'] = 'schoollist';
$data['title'] = '会员中心';
//删除操作
if(isset($_POST['muldel']) && $_POST['muldel']=='del')
{
$result = $this->user_model->delcollect($_POST['actionid']);
echo $result;exit;
}
//分页开始
$data['collect_num'] = $this->num_7;
$data['pagesize'] = 8;//设定每一页显示的记录数
$data['pages'] = $data['collect_num'] ? ceil($data['collect_num']/$data['pagesize']) : 0 ; //计算总页数
$data['page'] = $this->uri->segment(3) ? intval($this->uri->segment(3)) :1 ; // 获取当前页数
$data['page'] = ($data['page']>$data['pages'] && $data['pages']!=0) ? $data['pages'] : $data['page']; //判断跳转页数
$data['offset'] = $data['pagesize']*($data['page']-1); //计算记录偏移量
$data['collect'] = $this->user_model->getCollectSchoolList(7,$this->user_id,$data['offset'],$data['pagesize']);
//获取你可能感兴趣的二手房
$data['likesell'] = $this->user_model->getLikeSchoolHouse($this->user_id);
//BI统计 ----- start----->
$data['isa_website'] = '2,19,77';
$data['isa_city'] = GB_CITY;
$data['isa_addones'] = '';
$data['isa_url'] = 'isa.house365.com/js/analyze.js?v=2.1';
//BI统计 ----- ent----->
$this->load->view('my_attention_school',$data);
}
/**
* 我的二手房关注条件页面
* @author cxf
*/
public function sell_condition()
{
$data['conf_where'] = 'sell_condition';
$data['title'] = '我的关注';
$muldel = $this->input->post('muldel');
$actionid = $this->input->post('actionid');
//删除操作
if( isset( $muldel ) && $muldel == 'del')
{
$result = $this->user_model->delcollect($actionid);
echo $result;
exit;
}
//分页开始
$data['collect_num'] = $this->num_1;
$data['pagesize'] = 5;//设定每一页显示的记录数
//计算总页数
$data['pages'] = $data['collect_num'] ? ceil($data['collect_num']/$data['pagesize']) : 0 ;
//获取当前页数
$data['page'] = $this->uri->segment(3) ? intval($this->uri->segment(3)) : 1 ;
//判断跳转页数
$data['page'] = ($data['page']>$data['pages'] && $data['pages']!=0) ? $data['pages'] : $data['page'];
//计算记录偏移量
$data['offset'] = $data['pagesize']*($data['page']-1);
$data['collect'] = $this->user_model->getcollect(1,$this->user_id,$data['offset'],$data['pagesize']);
$data['sarr'] = $this->user_model->getSeachcondStr($data['collect']);
$data['surl'] = $this->user_model->getSeachcondUrl($data['collect'], 1);
//获取你可能感兴趣的二手房
$data['likesell'] = $this->user_model->getlikehouse($this->user_id,'sell',4);
//2018-8-16加,房源特色总标签
$data['house_features'] = $this->user_model->getHouseFeatures();
//BI统计 ----- start----->
$data['isa_website'] = '2,19,78';
$data['isa_city'] = GB_CITY;
$data['isa_addones'] = '';
$data['isa_url'] = 'isa.house365.com/js/analyze.js?v=2.1';
//BI统计 ----- ent----->
$this->load->view('my_sell_condition',$data);
}
/**
* 我的关注条件页面
* @author cxf
*/
public function rent_condition()
{
global $house;
$data['conf_where'] = 'sell_condition';
$data['title'] = '我的关注';
$data['priceunit'] = $house['priceunit'];
//删除操作
if(isset($_POST['muldel']) && $_POST['muldel']=='del')
{
$result = $this->user_model->delcollect($_POST['actionid']);
echo $result;exit;
}
//分页开始
$data['collect_num'] = $this->num_5;
$data['pagesize'] = 5;//设定每一页显示的记录数
$data['pages'] = $data['collect_num'] ? ceil($data['collect_num']/$data['pagesize']) : 0 ; //计算总页数
$data['page'] = $this->uri->segment(3) ? intval($this->uri->segment(3)) :1 ; // 获取当前页数
$data['page'] = ($data['page']>$data['pages'] && $data['pages']!=0) ? $data['pages'] : $data['page']; //判断跳转页数
$data['offset'] = $data['pagesize']*($data['page']-1); //计算记录偏移量
$data['collect'] = $this->user_model->getcollect(5,$this->user_id,$data['offset'],$data['pagesize']);
$data['sarr'] = $this->user_model->getSeachcondStr($data['collect']);
$data['surl'] = $this->user_model->getSeachcondUrl($data['collect'], 5);
//获取你可能感兴趣的租房
$data['likerent'] = $this->user_model->getlikehouse($this->user_id,'rent',4);
$this->load->view('my_rent_condition',$data);
}
/**
* 用户退出
* @author cxf
*/
public function logout()
{
vbsetcookie("esfuserid","",1);
vbsetcookie("esfpassword","",1);
vbsetcookie("esfusername","",1);
vbsetcookie("esfusertelno","",1);
vbsetcookie("esfshowname","",1);
vbsetcookie("esfusercity","",1);
vbsetcookie("sso_token","",1);
setcookie("esfuserid", null, time() - 1000, "/", "house365.com");
setcookie("esfusername", null, time() - 1000, "/", "house365.com");
setcookie("esfusertelno", null, time() - 1000, "/", "house365.com");
setcookie("sso_token", null, time() - 1000, "/", "house365.com");
setcookie("PHPSESSID", null, time() - 1000, "/", "house365.com");
setcookie("PHPSESSID", null, time() - 1000, "/", "newrent.house365.com");
unset($_SESSION['esfuserid']);
unset($_SESSION['esfpassword']);
unset($_SESSION['esfusername']);
unset($_SESSION['esfusertelno']);
unset($_SESSION['esfusercity']);
unset($_SESSION['esfshowname']);
unset($_SESSION['sso_token']);
setcookie("sessionid", null, time() - 1000, "/", "house365.com");
setcookie("newrent_yii2-session", null, time() - 1000, "/", "house365.com");
if(isset($_SERVER['HTTP_REFERER']))
{
$url = substr($_SERVER['HTTP_REFERER'], 0, 35);
$url1 = substr($_SERVER['HTTP_REFERER'], 0, 40);
if($url==USER_CENTER.'user' || $url1==USER_CENTER.'statistic' || $url==USER_CENTER.'want')
{
//jumptotk(GB_SELL_URL,"退出成功!将返回二手房首页!",3000,'tips');
jumpto(GB_SELL_URL);
}else{
//jumptotk($_SERVER['HTTP_REFERER'],"退出成功!将返回之前的页面!",3000,'tips');
jumpto($_SERVER['HTTP_REFERER']);
}
}else{
//jumptotk(GB_SELL_URL,"退出成功!将返回二手房首页!",3000,'tips');
jumpto(GB_SELL_URL);
}
exit();
}
public function bind_zmxy()
{
if (!defined('OPEN_ZMXY')) {
exit('该城市暂未开通此功能!');
}
//简单防止CSRF与模拟POST访问
$data['time'] = time();
$data['token'] = md5('house365'. $data['time'] . $this->user_id); //加盐
$_SESSION[$data['token']] = 1;
$data['conf_where'] = 'bind_zmxy';
$data['title'] = '认证管理';
$data = array_merge($data,$this->realNameData());
$this->load->model('user_model');
$data['user_card_info'] = $this->user_model->getUserCardInfo($this->user_id,1);
//获取银行的配置文件
require_once(APPPATH.'config/bank.php');
$data['bank'] = $bank;
//芝麻认证信息
$zhima = $this->user_model->getCertAuth($this->user_id,1);
//银联认证
$bank_cert = $this->user_model->getCertAuth($this->user_id,2);
$data['zhima'] = $zhima;
$data['bank_cert'] = $bank_cert;
if ($_POST) {
$result = array(
'status' => 0,
'msg' => '',
'url' => ''
);
$msg = '';
$sessionToken = $_SESSION[$_POST['token']];
unset($_SESSION[$_POST['token']]);
$_POST['truename'] = iconv('utf8','gbk',$_POST['truename']);
$_POST['truename'] = addslashes($_POST['truename']);
$_POST['idno'] = addslashes($_POST['idno']);
$checkData = $this->user_model->checkIdNo($_POST['idno'], $this->user_id);
if (!$checkData['result']) {
$msg = $checkData['msg'];
}
if (empty($_POST['idno']) || empty($_POST['truename'])) {
$msg = '参数错误!';
}
//页面有效时间为5分钟
$timeFlag = time() - $_POST['time'] > 300 ? true : false;
if ($_POST['token'] != md5('house365' . $_POST['time'] . $this->user_id) || $timeFlag || $sessionToken != 1) {
$msg = '页面已过期!请重新刷新页面';
}
if (!empty($msg)) {
$result['msg'] = iconv('gbk','utf8', $msg);
exit(json_encode($result));
}
$url = $this->doBindZmxy($_POST);
$result['status'] = 1;
$result['url'] = $url;
exit(json_encode($result));
}
$this->load->view('bind_zmxy',$data);
}
private function doBindZmxy($data)
{
$userInfo = array(
'name' => iconv('gbk', 'utf8', $data['truename']),
'certNo' => $data['idno'],
'certType' => 'IDENTITY_CARD'
);
$state = $userInfo;
$state['userId'] = $this->user_id;
$bizParams = array(
'auth_code' => 'M_APPPC_CERT',
'channelType' => 'apppc',
'state' => json_encode($state)
);
//业务参数数组
$params = array(
'identity_type' => '2',
'identity_param' => json_encode($userInfo),
'biz_params' => json_encode($bizParams)
);
$this->load->library("zmop_class");
$this->zmop_class->setRsaPriKeyFile(ZMXY_PRIVATE_KEY);
$this->zmop_class->setRsaPubKeyFile(ZMXY_PUBLIC_KEY);
$sign = $this->zmop_class->getSignature($params);
$encryptData = $this->zmop_class->encrypt($params);
// 公共参数数组
$sParam = array(
'app_id' => ZMXY_APPID,
'method' => "zhima.auth.info.authorize",
'charset' => "utf-8",
'version' => "1.0",
'params' => $encryptData,
'sign' => $sign
);
$str = http_build_query($sParam);
$url = 'https://zmopenapi.zmxy.com.cn/openapi.do?' . $str;
//添加日志记录
$logData = array(
'user_id' => $this->user_id,
'truename' => $data['truename'],
'idno' => $data['idno'],
'ip' => get_ip(),
'created_time' => time()
);
$this->user_model->addAuthLog($logData);
return $url;
}
public function zmxyCallback()
{
if (!defined('OPEN_ZMXY')) {
exit('该城市暂未开通此功能!');
}
$params = $this->input->get('params');
$sign = $this->input->get('sign');
if (empty($params) || empty($sign)) {
exit('参数缺失!');
}
//含有%则urldecode
$params = strstr ( $params, '%' ) ? urldecode ( $params ) : $params;
$sign = strstr ( $sign, '%' ) ? urldecode ( $sign ) : $sign;
$this->load->library("zmop_class");
$this->zmop_class->setRsaPriKeyFile(ZMXY_PRIVATE_KEY);
$this->zmop_class->setRsaPubKeyFile(ZMXY_PUBLIC_KEY);
//解密数据
$decryptData = $this->zmop_class->decrypt($params);
//验签
$result = $this->zmop_class->verify($decryptData, $sign);
if (!$result) {
exit('签名错误!');
}
parse_str($decryptData, $paramList);
if ($paramList['success'] == 'false' && !empty($paramList['error_message'])) {
$paramList['error_message'] = iconv('utf8', 'gbk', $paramList['error_message']);
$msg = "绑定失败!失败原因:" . $paramList['error_message'];
exit($msg);
}
//更新用户数据
$state = json_decode($paramList['state'], true);
if ($this->user_id != $state['userId']) {
exit('用户信息异常!');
}
$checkData = $this->user_model->checkIdNo($state['certNo'], $this->user_id);
if (!$checkData['result']) {
exit($checkData['msg']);
}
if (empty($state['name']) || empty($state['certNo']) || empty($paramList['open_id'])) {
exit('数据异常!');
}
$updateData['truename'] = iconv('utf8', 'gbk', $state['name']);
$updateData['idno'] = $state['certNo'];
$updateData['auth_type'] = 1;
$updateData['auth_open_id'] = $paramList['open_id'];
$this->user_model->updateuser($this->user_id, $updateData);
header('Location:' . GB_CRNTER_URL . 'user/bind_zmxy/');
}
/**
* 修改个人资料
* @author cxf
*/
function edit_profile()
{
$_SESSION['token'] = md5($this->user_id);
$data['js'] = '<script type="text/javascript" src="'.USER_CENTER.'js/jquery.Jcrop.min.js"></script>';
$data['conf_where'] = 'edit_profile';
$data['title'] = '修改资料';
$data['user_detail_old'] = $this->user_model->get_userdetail($this->user_id,array('username','email','sex','birthdate'));
if($_POST)
{
if($_POST['token'] != $_SESSION['token'])
{
//echo $_POST['token']."<br/>";
//echo $_SESSION['token']."<br/>";
echo "<script> alert('请输入正确的验证');</script>";die;
}
$arr['email'] = $this->input->post('email');
$arr['sex'] = $this->input->post('sex');
$arr['birthdate'] = strtotime($this->input->post('year')."-".$this->input->post('month')."-".$this->input->post('day'));
//var_dump($arr['birthdate']);exit;
$result = $this->user_model->updateuser($this->user_id,$arr);
}
$data['user_detail'] = $this->user_model->get_userdetail($this->user_id,array('username','email','sex','birthdate','head_pic'));
//BI统计 ----- start----->
$data['isa_website'] = '2,19,83';
$data['isa_city'] = GB_CITY;
$data['isa_addones'] = '';
$data['isa_url'] = 'isa.house365.com/js/analyze.js?v=2.1';
//BI统计 ----- ent----->
$this->load->view('edit_profile',$data);
}
/**
* 修改密码
* @author cxf
*/
function edit_password()
{
$_SESSION['token'] = md5($this->user_id);
$data['js']= '<script type="text/javascript" src="'.USER_CENTER.'js/Validform_v5.3.2_ncr_min.js"></script>';
$select = array('telno');
$data['user'] = $this->user_model->get_userdetail($this->user_id,$select);
$data['conf_where'] = 'edit_password';
$data['title'] = '修改密码';
if($_POST)
{
if($_POST['token'] != $_SESSION['token'])
{
//echo $_POST['token']."<br/>";
//echo $_SESSION['token']."<br/>";
//echo "<script> alert('请输入正确的验证');</script>";die;
}
$newpassword = $this->input->post('newpassword');
$againpassword = $this->input->post('againpassword');
$password = $this->input->post('password');
if($newpassword == $againpassword)
{
$result = $this->user_model->yzloginuser($this->user_id,md5($password));
if( $result > 0 )
{
$result_pass = $this->user_model->updatepassowrdbyuid($this->user_id,$newpassword);
echo $result_pass ? 1 : 4;
exit;
}else{
echo 3;
exit;
}
}
else
{
echo 2;
exit;
}
}
$this->load->view('edit_password',$data);
}
/**
* 修改电话号码
* @author cxf
*/
function edit_telno()
{
$_SESSION['token'] = md5($this->user_id);
$data['conf_where'] = 'edit_telno';
$data['title'] = '修改手机号码';
$data['js']= '<script type="text/javascript" src="'.USER_CENTER.'js/code.js"></script><script type="text/javascript" src="'.USER_CENTER.'js/Validform_v5.3.2_ncr_min.js"></script>';
$select = array('telno');
$data['user'] = $this->user_model->get_userdetail($this->user_id,$select);
if($_POST)
{
if($_POST['token'] != $_SESSION['token'])
{
//echo $_POST['token']."<br/>";
//echo $_SESSION['token']."<br/>";
echo "<script> alert('请输入正确的验证');</script>";die;
}
$telno = $this->input->post('telnoold');
$telnonew = $this->input->post('telno');
$validcode = $this->input->post('validcode');
$kind = $this->input->post('kind');
//验证手机号是否存在
$result2 = $this->user_model->yztelnolt($telnonew);
if($result2)
{
echo 3;
exit;
}
//验证短信验证码是否正确
$result = $this->user_model->yzusersms($validcode,$telnonew,$kind);
if($result>0)
{
$result_pass = $this->user_model->updatetelnobyuid($this->user_id,$telnonew);
if($result_pass)
{
$this->user_model->SyncPhoneUserCenter($this->user_id, $telno, $telnonew);
//修改已经绑定的400号码
$this->load->model("esf_400_model");
$this->esf_400_model->update_telno($this->user_id , $telnonew ,$telno);
}
echo $result_pass ? 1 : 0;
if($result2[0]['id']>0 && $result2[0]['infofrom']==2)
{
//对原有账号进行失效操作
$this->user_model->updateuser($result2[0]['id'],array('is_use'=>0));
//对原有房源进行id修改
$this->house_model->updatehouseuid($result2[0]['id'],$this->user_id,'sell');
$this->house_model->updatehouseuid($result2[0]['id'],$this->user_id,'rent');
}
exit;
}
else
{
echo 2;
exit;
}
}
$this->load->view('edit_telno',$data);
}
/**
* 编辑头像文件
* @author cxf
*/
function edit_headfile()
{
if($this->input->post("action") == 'headfile')
{
$fileurl = common_file_upload("headfile", false, false, 340, 220);
if($fileurl)
{
echo "<script>window.parent.setHeadimgsrc('".$fileurl."');window.parent.document.getElementById('headpic').value='".$fileurl."';window.parent.jcSetImage();window.parent.changeShowPic('headShowPic');</script>";
}
else
{
echo "<script>window.parent.document.getElementById('jsUploadHeadPortrait').style.display = 'none';window.parent.document.getElementById('jsDialogE_msg').innerHTML='图片上传失败,请重试!';window.parent.openWin('jsDialogE');setTimeout(function(){window.parent.location.reload();},1000);</script>";
}
exit;
}
else if( $this->input->post("action") == 'savehead' )
{
$headpic = trim($this->input->post("headpic"));
$x = floatval($this->input->post("x"));
$y = floatval($this->input->post("y"));
$w = floatval($this->input->post("w"));
$h = floatval($this->input->post("h"));
$picfile = curl_get_contents($headpic);
if( $picfile )
{
$targ_w = $w;
$targ_h = $h;
$jpeg_quality = 100;
//FISHER 2013-6-22
//获取远程图片再裁剪处理,然后还要FTP上传到图片服务器,目前只能在本地创建临时文件,想不出其他办法了。
$filename = GB_CITY.'_'.md5($headpic).".jpg";
$cachefile = APPPATH."/cache/".$filename;
if($handle = fopen($cachefile, "wb") && $targ_w > 0 && $targ_h > 0)
{
$img_r = imagecreatefromstring($picfile);
$dst_r = ImageCreateTrueColor($targ_w, $targ_h);
imagecopyresampled($dst_r,$img_r,0,0,$x,$y,$targ_w,$targ_h,$w,$h);
imagejpeg($dst_r, $cachefile, $jpeg_quality);
@fclose($handle);
$_FILES['headfile']['nocheck'] = "house365";//uploadfile 类会检查这个文件是否是POST提交的文件,没办法啊绕过去。
$_FILES['headfile']['name'] = $filename;
$_FILES['headfile']['type'] = 'image/pjpeg';
$_FILES['headfile']['tmp_name'] = $cachefile;
$_FILES['headfile']['error'] = 0;
$_FILES['headfile']['size'] = @filesize($cachefile);
$this->load->library('uploadfile_class',array('filename'=>"headfile"));
$this->uploadfile_class->setFileType("jpg");
$this->uploadfile_class->setMaxSize(5120);
$this->uploadfile_class->setUploadType("ftp");
$this->uploadfile_class->setSaveDir("/".GB_CITY."house/");
$this->uploadfile_class->setWatermark(false);
$this->uploadfile_class->setImageCut(false);
if ($this->uploadfile_class->upload() == "success")
{
$headpicurl = $this->uploadfile_class->getSaveFileURL(); //图片地址
}
else
{
$headpicurl = "";
}
@unlink($cachefile);
if($headpicurl != "")
{
//更新用户头像
$id = $this->user_model->updateheadpic($this->user_id,$headpicurl);
if($id > 0)
{
echo "<script>window.parent.openWin('upfile-ok');</script>";
}
else
{
echo "<script>window.parent.openWin('warning');</script>";
}
}
else
{
echo "<script>window.parent.openWin('warning');</script>";
}
}
else
{
echo "<script>window.parent.openWin('warning');setTimeout(function(){window.parent.location.reload();},1000);</script>";
}
}
else
{
echo "<script>window.parent.openWin('warning');setTimeout(function(){window.parent.location.reload();},1000);</script>";
}
exit;
}
}
/**
* 我的问答
* @author cxf
*/
function myask()
{
$data['conf_where'] = 'ask';
$data['title'] = '我的问答';
//分页开始
$data['ask_num'] = $this->ask_model->getquelistnum($this->user_id);
$data['pagesize'] = 8;//设定每一页显示的记录数
$data['pages'] = $data['ask_num'] ? ceil($data['ask_num']/$data['pagesize']) : 0 ; //计算总页数
$data['page'] = $this->uri->segment(3) ? intval($this->uri->segment(3)) :1 ; // 获取当前页数
$data['page'] = ($data['page'] > $data['pages']) ? $data['pages'] : $data['page']; //判断跳转页数
$data['offset'] = $data['pagesize']*($data['page']-1); //计算记录偏移量
//获取问题列表
$data['asklist'] = $this->ask_model->getquelist($this->user_id,$data['offset'],$data['pagesize']);
$data['expertslist'] = $this->ask_model->getexperts();
//BI统计 ----- start----->
$data['isa_website'] = '2,19,99';
$data['isa_city'] = GB_CITY;
$data['isa_addones'] = '';
$data['isa_url'] = 'isa.house365.com/js/analyze.js?v=2.1';
//BI统计 ----- ent----->
//print_r($data);die;
$this->load->view('myask',$data);
}
/**
* 提问详情页跳转页
* @author cxf
*/
function qdetail($qid)
{
$arr=array('a_qid'=>$qid,'a_esta'=>1,'a_read'=>0);
$up= array('a_read'=>1);
$this->user_model->set_table('qa_answer');
$result = $this->user_model->save($arr,$up,'esfhouse');
//更新问答未读的cookie
$ask_num = $this->ask_model->getnewanswerbyuid($this->user_id);
setcoandsess('esfasknum',$ask_num);
echo '<script language="javascript">location= "'.get_questioninfo_url($qid).'";</script>';
}
/**
* 我的消息
* @author cxf
*/
function mymessage()
{
$data['conf_where'] = 'message';
$data['title'] = '我的消息';
//删除操作
if(isset($_POST['muldel']) && $_POST['muldel']=='del')
{
$result = $this->user_model->delmessage($_POST['actionid']);
echo $result;
exit;
}
//更新消息的点击状态
$this->user_model->updateannounceclick($this->user_id);
$data['num'] = $this->user_model->getmessagenumbyuid($this->user_id);
$data['pagesize'] = 8;//设定每一页显示的记录数
$data['pages'] = $data['num'] ? ceil($data['num']/$data['pagesize']) : 0 ; //计算总页数
$data['page'] = $this->uri->segment(3) ? intval($this->uri->segment(3)) :1 ; // 获取当前页数
$data['page'] = ($data['page']>$data['pages'] && $data['pages']!=0) ? $data['pages'] : $data['page']; //判断跳转页数
$data['offset'] = $data['pagesize']*($data['page']-1); //计算记录偏移量
$data['message'] = $this->user_model->getmessagebyuid($this->user_id,$data['offset'],$data['pagesize']);
//BI统计 ----- start----->
$data['isa_website'] = '2,19,82';
$data['isa_city'] = GB_CITY;
$data['isa_addones'] = '';
$data['isa_url'] = 'isa.house365.com/js/analyze.js?v=2.1';
//BI统计 ----- ent----->
$this->load->view('mymessage',$data);
}
function updateread()
{
$ids = $this->input->post("ids");
if(!empty($ids))
{
$id_arr = explode(',',$ids);
foreach($id_arr as $value)
{
$result = $this->user_model->updateannounce($value);
}
}else{
$result = $this->user_model->updateannounce($this->input->post("id"));
}
echo $result;
}
/**
* 实名认证弹窗
* @return array
*/
private function realNameData(){
$data = array();
$data['userInfo'] = $this->user_model->get_userdetail($this->user_id,array('truename','idno','auth_type','auth_open_id','passport_uid'));
// $data['imgUrl'] = 'http://mtt.house365.com/H5/pctoapp/index.php?city=nj&TFRouteType=1058&TFRouteParm=' .urlencode(urlencode('type=3&uuid='.$data['userInfo'][0]['passport_uid']));
// $data['imgUrl'] = 'http://newrent.house365.com/api/common/get-qr-code?size=144&margin=0&url='.urlencode($data['imgUrl']);
$data['imgUrl'] = '/images/downloadTFApp.png';
$data['imgUrlbg2'] = '/images/smbg2.png';
$data['imgUrlbg1'] = '/images/mybg.png';
if(GB_CITY == 'wh'){
$data['publishUrlSell'] = 'http://publish.wh.house365.com/?newWh=1&kind=1';
}else{
$data['publishUrlSell'] = "http://".GB_CITY.".publish.house365.com";
}
if(GB_CITY == 'nj'){
$data['publishUrlRent'] = "http://publish.house365.com/nj/publish";
}else if(GB_CITY == 'wh'){
$data['publishUrlRent'] = "http://publish.wh.house365.com/?newWh=1&kind=2";
}else{
$data['publishUrlRent'] = " http://".GB_CITY.".publish.house365.com/?kind=2";
}
return $data;
}
/**
* 我的房源二手房
* @author cxf
*/
function myhousesell()
{
header("Location:http://newrent.house365.com/user-center/sell-list");
die;
$data['conf_where'] = 'housesell';
$data['title'] = '我的房源';
$this->load->model('package_model');
$data['limitNumGtZero'] = $this->package_model->getLimitNumGtZero();
$data = array_merge($data,$this->realNameData());
if($_POST)
{
$id = $this->input->post('id');
$type = $this->input->post('type');
$code = $this->input->post('code');
$infotype = $this->input->post('infotype');
$payday = $this->input->post('payday');
$paytype = $this->input->post('paytype');
//推广处理
if($type =='tg'){
//更新房源状态,改为有意向
$result = $this->house_model->updatehouse($id,'sell',array('ischarge'=>'2'));
//记录客户意向
$result1 = $this->user_model->addusercharge($id, $paytype , $payday,$this->user_id );
if($result1>0)
{
//发送消息
$subject='您的房源推广申请已提交。';
$msg='您编号为"'.$id.'"的房源推广申请正在审核中,请耐心等待。';
$this->apply_class->send_systemmsg($this->user_id,$subject,$msg,1,GB_CITY);
//添加成功
echo '1';exit;
}else{
//添加失败
echo '3';exit;
}
}
//验证
if(md5($id.'house365')==$code)
{
if($type =='refresh')
{
//验证刷新可用次数
$num = $this->house_model->yzrefrshnum($this->user_id,$id,'sell');
//获取今日已刷新次数
$this->house_statistic_model->set_uid($this->user_id);
$this->house_statistic_model->set_city(GB_CITY);
$this->house_statistic_model->set_nocache(1);
$arr = $this->house_statistic_model->get_operate_list(2,$id,date("Y-m-d"));
//获得实际可刷新次数
$num = $num - count($arr);
if($num>0)
{
//更新房源刷新时间
$result = $this->house_model->updatehouse($id,'sell',array('updatetime'=>time()));
//记录刷新操作
$this->house_statistic_model->set_uid($this->user_id);
$this->house_statistic_model->set_city(GB_CITY);
$result = $this->house_statistic_model->sub_operate_log('sell' , $id , 2 );
if($result['is_ok'] == 1)
{
//发送消息
$subject='您的房源刷新成功';
$msg='您编号为"'.$id.'"房源刷新成功。如有疑问,请联系客服。';
$this->apply_class->send_systemmsg($this->user_id,$subject,$msg,1,GB_CITY);
//刷新成功
$arr1['msg'] = 1;
$arr1['num'] = $num-1;
print json_encode($arr1);exit;
}else{
//刷新失败
$arr1['msg'] = 4;
$arr1['num'] = $num;
print json_encode($arr1);exit;
}
}else{
//刷新次数不足
$arr1['msg'] = 3;
$arr1['num'] = $num;
print json_encode($arr1);exit;
}
}elseif($type =='del'){
//更新房源状态,相当于失效状态
$result = $this->house_model->updatehouse($id,'sell',array('esta'=>'2'));
//记录再发布操作
$this->house_statistic_model->set_uid($this->user_id);
$this->house_statistic_model->set_city(GB_CITY);
$result1 = $this->house_statistic_model->sub_operate_log('sell' , $id , 3 );
if($result>0)
{
//删除成功
echo '1';
exit;
}else{
//删除失败
echo '3';
exit;
}
}
elseif($type =='again_pub')
{
//更新房源状态
if(GB_CITY == 'nj')
{
if($infotype==1 or $infotype==2)
{
$expiretime = strtotime("+45 day");
}
else if($infotype==3 or $infotype==4 or $infotype==5 or $infotype==6)
{
$expiretime = strtotime("+60 day");
}
}
else
{
$expiretime = strtotime("+90 day");
}
$result = $this->house_model->republishhouse($id,'sell',array('esta'=>'1','creattime'=>time(),'updatetime'=>time(),'expiretime'=>$expiretime),GB_CITY);
//记录再发布操作
$this->house_statistic_model->set_uid($this->user_id);
$this->house_statistic_model->set_city(GB_CITY);
//$result1 = $this->house_statistic_model->sub_operate_log('sell' , $id , 5 ,1);
if($result>0)
{
$this->load->model('user_model');
//增加云信accid
$this->user_model->yunxin_accid($this->user_id);
//再发布成功
echo '1';exit;
}else{
//再发布失败
echo '3';exit;
}
}else{
//验证不通过,来源不正确
echo '2';exit;
}
}else{
//验证不通过,来源不正确
echo '2';exit;
}
}
$data['num'] = $this->house_model->gethousenumbyuid($this->user_id,'sell');
$data['pagesize'] = 8;//设定每一页显示的记录数
$data['pages'] = $data['num'] ? ceil($data['num']/$data['pagesize']) : 0 ; //计算总页数
$data['page'] = $this->uri->segment(3) ? intval($this->uri->segment(3)) :1 ; // 获取当前页数
$data['page'] = ($data['page']>$data['pages'] && $data['pages']!=0) ? $data['pages'] : $data['page']; //判断跳转页数
$data['offset'] = $data['pagesize']*($data['page']-1); //计算记录偏移量
if(GB_CITY=='nj' || GB_CITY=='wh')
{
$data['house_array'] = $this->house_model->gethousebyuid($this->user_id,'sell',array('id','address','buildarea','price','updatetime','creattime','esta','ischarge','pic1','district','streetid','blockshowname','infotype','room','hall','fitment','buildarea','ischarge','telno','floor ','subfloor','totalfloor','survey'),$data['offset'],$data['pagesize']);
}
else
{
$data['house_array'] = $this->house_model->gethousebyuid($this->user_id,'sell',array('id','address','buildarea','price','updatetime','creattime','esta','ischarge','pic1','district','streetid','blockshowname','infotype','room','hall','fitment','buildarea','ischarge','telno','floor ','subfloor','totalfloor'),$data['offset'],$data['pagesize']);
}
if (is_array($data['house_array'])) {
if(GB_CITY=='nj'){
$this->load->model('survey_model');
$modelSurvey = new Survey_model();
}elseif(GB_CITY == 'wh'){
$this->load->model('vr_model');
$modelSurvey = new Vr_model();
}
foreach($data['house_array'] as &$value) {
$value['survey_status'] = '';
$value['can_survey'] = false;
$value['show_survey_icon'] = false;
if(intval($value['esta']) != 1){
$value['survey'] = 0;
}
if ($data['limitNumGtZero'][5]['sell'] && intval($value['survey']) != 1 && intval($value['esta']) == 1 && in_array(GB_CITY, array_keys($this->surveyConfig)) && in_array(intval($value['infotype']), $this->surveyConfig[GB_CITY]['surveyInfotype']) && in_array($value['district'], $this->surveyConfig[GB_CITY]['surveyDistrict'])) {
$value['can_survey'] = true;
}
if(intval($value['survey']) == 1) {
if(GB_CITY=='nj'){
$surveyInformation = $modelSurvey->getInformation('sell', $value['id']);
$status = isset($surveyInformation[0]['status']) ? intval($surveyInformation[0]['status']) : 0;
if ($status == 3 && !empty($surveyInformation[0]['time_order']) && time() > intval($surveyInformation[0]['time_order'])) {
$status = 4;
}
if($status != 2){
$value['show_survey_icon'] = true;
}
$value['survey_status'] = isset($this->surveyStatus[$status]) ? $this->surveyStatus[$status] : '实勘未知状态';
}elseif(GB_CITY=='wh'){
$surveyInformation = $modelSurvey->getVrInfoByHouseId('sell', $value['id']);
if($surveyInformation){
$value['show_survey_icon'] = $surveyInformation['show_icon'];
$value['survey_status'] = $surveyInformation['vr_status_word'];
}
}
}
//获取房源已有套餐
if(in_array(GB_CITY,$this->openPayCitys)){
$packageData = $this->package_model->getHousePackageNew($value['id'],'sell');
if($packageData){
if(isset($packageData['leftTime'])) $value['leftTime'] = $packageData['leftTime'];
if(in_array(1,$packageData['package_types']) || in_array(2,$packageData['package_types']) || in_array(3,$packageData['package_types'])){
$value['promoting'] = 1;
}else{
$value['promoting'] = 0;
}
}
}
}
}
//中奖通知 5.25-8.31
$data['is_win'] = $this->_get_is_win();
//BI统计 ----- start----->
$data['isa_website'] = '2,19,72';
$data['isa_city'] = GB_CITY;
$data['isa_addones'] = '';
$data['isa_url'] = 'isa.house365.com/js/analyze.js?v=2.1';
//BI统计 ----- ent----->
$data['userInfo'] = $this->user_model->get_userdetail($this->user_id,array('truename','idno','auth_type','auth_open_id','passport_uid','bank_type'));
$this->load->view('myhousesell',$data);
}
/**
* 我的房源二手房
* @author cxf
*/
function myhouserent()
{
header("Location:http://newrent.house365.com/user-center/rent-list");
die;
global $house;
$data['conf_where'] = 'houserent';
$data['title'] = '我的房源';
$data = array_merge($data,$this->realNameData());
$this->load->model('package_model');
$data['limitNumGtZero'] = $this->package_model->getLimitNumGtZero();
if($_POST)
{
$id = $this->input->post('id');
$type = $this->input->post('type');
$code = $this->input->post('code');
$infotype = $this->input->post('infotype');
$payday = $this->input->post('payday');
$paytype = $this->input->post('paytype');
//推广处理
if($type =='tg'){
//更新房源状态,改为有意向
$result = $this->house_model->updatehouse($id,'rent',array('ischarge'=>'2'));
//记录客户意向
$result1 = $this->user_model->addusercharge($id, $paytype , $payday,$this->user_id,'rent' );
if($result1>0)
{
//发送消息
$subject='您的房源推广申请已提交。';
$msg='您编号为"'.$id.'"的房源推广申请正在审核中,请耐心等待。';
$this->apply_class->send_systemmsg($this->user_id,$subject,$msg,1,GB_CITY);
//添加成功
echo '1';exit;
}else{
//添加失败
echo '3';exit;
}
}
//验证
if(md5($id.'house365')==$code)
{
if($type =='refresh')
{
//验证刷新可用次数
$num = $this->house_model->yzrefrshnum($this->user_id,$id,'rent');
//获取今日已刷新次数
$this->house_statistic_model->set_uid($this->user_id);
$this->house_statistic_model->set_city(GB_CITY);
$this->house_statistic_model->set_nocache(1);
$arr = $this->house_statistic_model->get_operate_list(2,$id,date("Y-m-d"));
//获得实际可刷新次数
$num = $num - count($arr);
if($num>0)
{
//更新房源刷新时间
$result = $this->house_model->updatehouse($id,'rent',array('updatetime'=>time()));
if(empty($result))
{
$arr1['msg'] = 4;
$arr1['num'] = $num;
print json_encode($arr1);exit;
}
//记录刷新操作
$this->house_statistic_model->set_uid($this->user_id);
$this->house_statistic_model->set_city(GB_CITY);
$result = $this->house_statistic_model->sub_operate_log('rent' , $id , 2,1);
if($result['is_ok'] == 1)
{
//发送消息
$subject='您的房源刷新成功';
$msg='您编号为"'.$id.'"房源刷新成功。如有疑问,请联系客服。';
$this->apply_class->send_systemmsg($this->user_id,$subject,$msg,1,GB_CITY);
//刷新成功
$arr1['msg'] = 1;
$arr1['num'] = $num-1;
print json_encode($arr1);exit;
}else{
//刷新失败
$arr1['msg'] = 4;
$arr1['num'] = $num;
print json_encode($arr1);exit;
}
}else{
//刷新次数不足
$arr1['msg'] = 3;
$arr1['num'] = $num;
print json_encode($arr1);exit;
}
}elseif($type =='del'){
//更新房源状态
$result = $this->house_model->updatehouse($id,'rent',array('esta'=>2));
//记录再发布操作
$this->house_statistic_model->set_uid($this->user_id);
$this->house_statistic_model->set_city(GB_CITY);
$result1 = $this->house_statistic_model->sub_operate_log('rent' , $id , 3 );
if($result>0)
{
//通知爱租哪
if(GB_CITY == 'nj' || GB_CITY == 'hf')
{
$houseData = $this->house_model->gethousebywhere(array('id' => $id),'rent',array('iszhizu'),1);
if(!empty($houseData) && $houseData[0]['iszhizu'] == '1')
{
$url = 'http://mtapi.house365.com/?method=zhizu.ApiRent_syncEsf2AznStatus&city='.GB_CITY.'&id='.$id.'&esta=2&uid='.$this->user_id;
curl_get_contents($url);
}
}
//删除成功
echo '1';exit;
}
else
{
//删除失败
echo '3';exit;
}
}
elseif($type =='again_pub')
{
//更新房源状态
if(GB_CITY == 'nj')
{
if($infotype == 1 or $infotype == 2)
{
$expiretime = strtotime("+35 day");
}
else if($infotype==3 or $infotype==4 or $infotype==5 or $infotype==6)
{
$expiretime = strtotime("+60 day");
}
}
else
{
$expiretime = strtotime("+90 day");
}
$result = $this->house_model->republishhouse($id,'rent',array('esta'=>1,'creattime'=>time(),'updatetime'=>time(),'expiretime'=>$expiretime),GB_CITY);
//记录再发布操作
$this->house_statistic_model->set_uid($this->user_id);
$this->house_statistic_model->set_city(GB_CITY);
$result1 = $this->house_statistic_model->sub_operate_log('rent' , $id , 5 );
if($result>0)
{
//通知爱租哪
if(GB_CITY == 'nj' || GB_CITY == 'hf')
{
$houseData = $this->house_model->gethousebywhere(array('id' => $id),'rent',array('iszhizu'),1);
if(!empty($houseData) && $houseData[0]['iszhizu'] == '1')
{
$url = 'http://mtapi.house365.com/?method=zhizu.ApiRent_syncEsf2AznStatus&city='.GB_CITY.'&id='.$id.'&esta=1&uid='.$this->user_id;
curl_get_contents($url);
}
}
$this->load->model('user_model');
//增加云信accid
$this->user_model->yunxin_accid($this->user_id);
//再发布成功
echo '1';exit;
}else{
//再发布失败
echo '3';exit;
}
}else{
//验证不通过,来源不正确
echo '2';exit;
}
}else{
//验证不通过,来源不正确
echo '2';exit;
}
}
$data['num'] = $this->house_model->gethousenumbyuid($this->user_id,'rent');
$data['pagesize'] = 8;//设定每一页显示的记录数
$data['pages'] = $data['num'] ? ceil($data['num']/$data['pagesize']) : 0 ; //计算总页数
$data['page'] = $this->uri->segment(3) ? intval($this->uri->segment(3)) :1 ; // 获取当前页数
$data['page'] = ($data['page']>$data['pages'] && $data['pages']!=0) ? $data['pages'] : $data['page']; //判断跳转页数
$data['offset'] = $data['pagesize']*($data['page']-1); //计算记录偏移量
//获取房源
$data['house_array'] = $this->house_model->gethousebyuid($this->user_id,'rent',array('id','address','buildarea','price','updatetime','creattime','esta','ischarge','pic1','district','streetid','blockshowname','infotype','room','hall','fitment','buildarea','priceunit','ischarge','telno','floor ','subfloor','totalfloor'),$data['offset'],$data['pagesize']);
//获取房源已有套餐
if(in_array(GB_CITY,$this->openPayCitys)){
foreach($data['house_array'] as &$value) {
$packageData = $this->package_model->getHousePackageNew($value['id'],'rent');
if($packageData){
if(isset($packageData['leftTime'])) $value['leftTime'] = $packageData['leftTime'];
if(in_array(1,$packageData['package_types']) || in_array(2,$packageData['package_types']) || in_array(3,$packageData['package_types'])){
$value['promoting'] = 1;
}else{
$value['promoting'] = 0;
}
}
}
}
$data['priceunit'] = $house['priceunit'];
//中奖通知 5.25-8.31
$data['is_win'] = $this->_get_is_win();
//BI统计 ----- start----->
$data['isa_website'] = '2,19,73';
$data['isa_city'] = GB_CITY;
$data['isa_addones'] = '';
$data['isa_url'] = 'isa.house365.com/js/analyze.js?v=2.1';
//BI统计 ----- ent----->
$data['userInfo'] = $this->user_model->get_userdetail($this->user_id,array('truename','idno','auth_type','auth_open_id','passport_uid','bank_type'));
$this->load->view('myhouserent',$data);
}
/**
* 获取当前会员是否获取奖品
*
*/
private function _get_is_win()
{
$result = array();
if(GB_CITY == 'nj' && false)
{
$time = time();
$start_date = mktime(0,0,0,5,25,date('Y'));
$end_date = mktime(23,59,59,12,23,date('Y'));
if($start_date <= $time && $time <= $end_date)
{
$user_data = $this->user_model->get_user_data($this->user_id);
if(!empty($user_data) && !empty($user_data['telno']))
{
$result = $this->user_model->check_is_win($this->user_id,$user_data['telno'],$start_date,$end_date);
}
}
}
return $result;
}
//价格提醒处理ajax
function price_remind_ajax(){
// error_reporting(7);
// ini_set("display_errors",true);
$this->load->model("user_model");
$houseid = $this->input->post('houseid');
$type = $this->input->post('type');
$flag = $this->input->post('flag');
$priceRemindNum = $this->user_model->getPriceRemindNum($this->user_id);
if($priceRemindNum>=5&&$flag==1){//满4条提示
$result = 3;
}else{
$isChoice = $this->user_model->isCheckPriceRemind($this->user_id,$houseid);
//var_dump($isChoice);exit();
if(is_array($isChoice)){
if(empty($isChoice)&&$flag==1){
$result = $this->user_model->addPriceRemind($houseid,$this->user_id);
//echo "444";
}elseif($isChoice[0]['status']==1&&$flag==0){
$result = $this->user_model->updatePrcieRemind($houseid,$this->user_id,0);
}elseif($isChoice[0]['status']==0&&$flag==1){
$result = $this->user_model->updatePrcieRemind($houseid,$this->user_id,1);
}
}
}
echo $result = $result ? $result :0;
}
public function pay(){
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept');
if(GB_CITY != 'nj' && GB_CITY != 'wh'){
return $this->jump(USER_CENTER,'该城市暂未开通此功能!',3000,'warning');
}
//定义支持的支付类型
$payTypeArr = array('wxpay');
//获取房源属性
$packageId = intval($this->input->post('package_id',true));
$houseId = intval($this->input->post('house_id',true));
$tbl = addslashes($this->input->post('tbl',true));
$packageType = intval($this->input->post('package_type',true));
$packageKeyword = intval($this->input->post('package_keyword',true));
$day = intval($this->input->post('day_'.$packageType,true));
$payType = addslashes($this->input->post('pay_type',true));
// 租房8折优惠券 20200507添加
$use_coupon = intval($this->input->post('use_coupon',true));
if(empty($packageId) || empty($houseId) || empty($tbl) || empty($packageType) || (!in_array($packageType,array(4,5)) && empty($day)) || empty($payType) || !in_array($payType,$payTypeArr)){
return $this->jump(USER_CENTER,'参数缺失',3000,'warning');
}
$searchArr['id'] = $houseId;
$searchArr['uid'] = $this->user_id;
$searchArr['infofrom'] = 1;
$searchArr['esta'] = 1;
//获取房源信息
$houseData = $this->house_model->gethousebywhere($searchArr,$tbl,array('id,infotype,district,telno'),1);
if(empty($houseData)){
return $this->jump(USER_CENTER,'房源状态异常',3000,'warning');
}
$infoType = $houseData[0]['infotype'] == 1 ? 1 : 2;
//加载套餐model类
$this->load->model("package_model");
$packageData = $this->package_model->getDetailById($packageId);
if(empty($packageData)){
return $this->jump(USER_CENTER,'套餐状态异常',3000,'warning');
}
//价格数据
$packageData['package_desc'] = unserialize($packageData['package_desc']);
foreach($packageData['package_desc'] as $item){
if($packageType == 4){
$price = floatval($item['price']);
}else if($packageType == 5){
if($item['property_type'] == $infoType){
$price = floatval($item['price']);
//处理折扣
if(isset($item['discount']) && $item['discount'] >0){
$price = $this->pirceDiscount($price,$item['discount']);
}
}
}else{
if($item['property_type'] == $infoType && $item['day'] == $day){
$price = floatval($item['price']);
if(GB_CITY == 'wh' && $packageType == 2){
//处理折扣
if(isset($item['discount']) && $item['discount'] >0){
$price = $this->pirceDiscount($price,$item['discount']);
}
}
// 列表套餐8折券使用 20200507
if( GB_CITY == 'nj' && $packageType == 2 && $tbl == 'rent'){
//
$checkbox_status = 0;
// 检查是否有可用的优惠券,如果有则使用,如果无,则跳转提示
$userInfoData = $this->user_model->getuserdetail($this->user_id);
$passport_uid = $userInfoData ? $userInfoData['passport_uid'] : 0;
// 测试数据
if( $this->user_id == '1785149' || $this->user_id == '3367096'){
$price = 0.04;
}
if( isset($use_coupon) && $use_coupon == 1){
$check_coupon = $this->rent_coupon_model->checkCoupon($passport_uid);
if( !$check_coupon ){
return $this->jump(USER_CENTER,'租房优惠券状态异常',3000,'warning');
}
$checkbox_status = 1;
// 列表优先套餐8折
$price = sprintf("%.2f",$price * 0.8);
// 锁定半小时
$this->rent_coupon_model->lockCoupon($passport_uid);
}
// 设置8折优惠券的选中状态
$this->rent_coupon_model->setCheckbox($passport_uid,$checkbox_status);
}
}
}
}
if($this->user_id == 2909549 || $this->user_id == 3137198){
$price = 0.01;
}
//校验参数正确性
if($packageType != $packageData['package_type'] || empty($price) || $price <= 0){
return $this->jump(USER_CENTER,'套餐价格数据异常',3000,'warning');
}
if($packageType == 1 && ( $packageKeyword != $packageData['package_keyword'] || $packageKeyword <= 0 ) ){
return $this->jump(USER_CENTER,'套餐关键词异常',3000,'warning');
}
//首页推荐需要限制数量
if($packageType == 1){
//已售出和已锁定的套餐数量
$count = $this->package_model->getPackageNum($packageKeyword,$tbl);
if($count >= $packageData['package_num']){
return $this->jump(USER_CENTER,'套餐已售完',3000,'warning');
}
}
//wh实勘限制购买数量
if($packageType == 5){
//城市限制
if (!in_array($houseData[0]['district'], $this->surveyConfig[GB_CITY]['surveyDistrict'])) {
return $this->jump(USER_CENTER,'所在区域实勘服务暂未开通',3000,'warning');
}
$this->load->model('vr_model');
$countVr = $this->vr_model->getVrApplyNowNum(1,3); //sell 个人房源
$countOrder = $this->package_model->getPackageOrderNumByType($packageType,$tbl); //未支付有效订单
if( $countVr+$countOrder >= $packageData['package_num']){
return $this->jump(USER_CENTER,'套餐已售完',3000,'warning');
}
}
//首页推荐和列表排序在有效期内不能同时购买(南京租房除外 修改日期2020/3/4)
//获取该房源的套餐状态
$housePackage = $this->package_model->getHousePackage($houseId,$tbl);
//获取禁止的套餐数组
$banHousePackage = array();
if(!empty($housePackage)){
foreach($housePackage as $k =>$v){
if($v == 1 || $v == 2){
if(GB_CITY == 'nj' && $tbl == 'rent'){
$banHousePackage[] = $v;
}else{
$banHousePackage[] = 1;
$banHousePackage[] = 2;
}
}
if($v == 3){
$banHousePackage[] = 3;
}
}
}
if(in_array($packageData['package_type'],$banHousePackage)){
return $this->jump(USER_CENTER,'请勿重复购买套餐',3000,'warning');
}
//创建订单
$tblArr = array('sell' => 1 ,'rent' => 2);
$tableId = $tblArr[$tbl];
$orderData = array();
$orderData['transaction_id'] = $this->package_model->getTransactionId($packageType);
$orderData['user_id'] = $this->user_id;
$orderData['house_type'] = $tableId;
$orderData['house_id'] = $houseId;
$orderData['house_tel'] = $houseData[0]['telno'];
$orderData['package_id'] = $packageId;
$orderData['package_type'] = $packageType;
if($packageType == 1){
$orderData['package_keyword'] = $packageKeyword;
}
$orderData['package_days'] = $day;
$orderData['price'] = $price;
$orderData['create_time'] = time();
$orderData['pay_type'] = $payType;
$orderData['source'] = 1;
$orderData['ip'] = get_ip();
$orderId = $this->package_model->createOrder($orderData);
$orderData['id'] = $orderId;
//极小概率出现的订单号重复处理
if($orderId <= 0){
return $this->jump(USER_CENTER ,'订单创建失败',3000,'warning');
}
$data = $this->getWxPayCodeByHouse365($orderId);
if($data['status'] != 1){
return $this->jump(USER_CENTER , $data['msg'],3000,'warning');
}
$data['orderData'] = $orderData;
$data['title'] = '微信支付';
$this->load->view('wxpay',$data);
}
/**
* 折扣
* @param $price
* @param $discount
*/
private function pirceDiscount($price,$discount){
return $price*$discount/10;
}
/**
* 向house365支付中台查询订单状态
* @param $transactionId
* @return string
*/
public function queryOrder($transactionId){
$data = array('status' => 0);
if(!in_array(GB_CITY,$this->openPayCitys)){
echo json_encode($data);exit;
}
$this->load->model("package_model");
$curlData = array();
$curlData['serviceCode'] = 'pay';
$curlData['serviceName'] = 'queryOrder';
$curlData['actId'] = $this->openPayCitysActId[GB_CITY];
$curlData['tradeNo'] = $transactionId;
$curlData['sign'] = $this->package_model->makeSign($curlData);
$url = 'https://pay.house365.com/house365-pay-web/rest/interface';
$result = SendDataByCurl($url,$curlData);
$result = json_decode($result,true);
if(!empty($result['status'])){
$result['status'] = iconv('utf-8','gbk',$result['status']);
}
if(!empty($result) && $result['result'] == 'SUCCESS' && $result['status'] == '支付成功'){
$data['status'] = 1;
//测试环境无法回调的处理
//$orderInfo = $this->package_model->getOrderInfoByTransactionId($transactionId);
//$this->package_model->payFinish($orderInfo);
}
echo json_encode($data);exit;
}
/**
* 根据订单ID生成微信支付二维码
* @param $orderId 订单ID
* @return array
*/
private function getWxPayCodeByHouse365($orderId){
//加载套餐model类
$data['status'] = 0;
$this->load->model("package_model");
$packageData = $this->package_model->getOrderInfoById($orderId);
if(empty($packageData) || $packageData['order_status'] == 0 || $packageData['pay_status'] == 1){
$msg = '订单信息异常';
$data['msg'] = $msg;
return $data;
}
$transaction_id = $packageData['transaction_id'];
$price = $packageData['price'];
$notifyUrl = 'http://user.house365.com/esf_center_api/notify?city='.GB_CITY;
//$price = 0.01;
//$notifyUrl = 'http://esfadmin.house365.com/test.php';
$packageTypeName = $this->package_model->getPackageTypeName($packageData['package_type']);
$subject = '个人房源增值服务-'.$packageTypeName;
//拼接数组
$curlData = array();
$curlData['serviceCode'] = 'pay';
$curlData['serviceName'] = 'createAPPReceiptOrder';
//活动标识
switch (GB_CITY){
case 'nj' :
$curlData['actId'] = '57';
break;
case 'wh' :
$curlData['actId'] = '82';
break;
}
$curlData['tradeNo'] = $transaction_id;
$curlData['version'] = '1.0';
$curlData['notifyUrl'] = $notifyUrl;
$curlData['amount'] = $price * 100;
$curlData['city'] = GB_CITY;
$curlData['wechatTradeType'] = 1;
$curlData['subject'] = iconv('gbk','utf-8',$subject);
//订单过期时间为30分钟,考虑到网络延迟加上10S
$curlData['timeExpire'] = date("YmdHis", time() + 30 * 60 + 10);
$IpHostAllow =explode('.',get_ip());
if($IpHostAllow[0] == '192' && ($_COOKIE['is_test_wh'] == 'test' || (isset($_COOKIE['esfuserid']) && $_COOKIE['esfuserid'] == 2640088))){
$orderInfo = $this->package_model->getOrderInfoByTransactionId($transaction_id);
$this->package_model->payFinish($orderInfo);
$data['status'] = 1;
$data['msg'] = "支付完成!";
$data['is_test'] = 1;
return $data;
}
$curlData['sign'] = $this->package_model->makeSign($curlData);
$url = 'https://pay.house365.com/house365-pay-web/rest/interface';
$result = SendDataByCurl($url,$curlData);
$result = json_decode($result,true);
if(!empty($result['payParams']) && !is_array($result['payParams'])){
$result['payParams'] = json_decode($result['payParams'],true);
}
if( empty($result) || $result['result'] != 'SUCCESS' || empty($result['payParams']['code_url']) ){
$msg = !empty($result['payParams']['msg']) ? $result['payParams']['msg'] : $result['msg'];
//若未返回错误信息则返回默认错误信息
$msg = !empty($msg) ? iconv('utf-8','gbk',$msg): '支付参数有误';
$data['msg'] = $msg;
return $data;
}
$data['status'] = 1;
//此处调用微信支付的生成二维码接口,后期如果微信接口不能访问请自行用qrcode生成二维码
// $data['url'] = 'http://paysdk.weixin.qq.com/example/qrcode.php?data='.urlencode($result['payParams']['code_url']);
// $data['url'] = 'http://qr.liantu.com/api.php?text='.urlencode($result['payParams']['code_url']);
$data['url'] = 'http://newrent.house365.com/api/common/get-qr-code?size=298&margin=0&url='.urlencode($result['payParams']['code_url']);
return $data;
}
/**
* 根据房源获取该房源可以购买的套餐
* @param int $houseId 房源ID
* @param string $tbl sell/rent
* @param string $type promote:房源推广 refresh:房源刷新
*/
public function getPersonalHousePackage($houseId , $tbl = 'sell' , $type = 'promote')
{
if(GB_CITY != 'nj' && GB_CITY != 'wh'){
return;
}
$this->load->model('package_model');
$packageData = $this->package_model->getPackageByHouseId($houseId,$tbl);
$promoteData = array();
$refreshData = array();
$surveyData = array();
foreach($packageData as $key => $value){
if($value['package_type'] == 1 && GB_CITY == 'nj'){
$promoteData[] = $value;
}
if($value['package_type'] == 2 ){
$promoteData[] = $value;
}
if($value['package_type'] == 3 || $value['package_type'] == 4){
$refreshData[] = $value;
}
if($value['package_type'] == 5 && GB_CITY == 'wh'){
$surveyData[] = $value;
}
}
if($type == 'promote'){
echo json_encode($promoteData);
}
if($type == 'refresh'){
echo json_encode($refreshData);
}
if($type == 'survey'){
echo json_encode($surveyData);
}
}
public function orderInvoice($orderId = '0'){
if(GB_CITY != 'nj' && GB_CITY != 'wh'){
return $this->jump(USER_CENTER ,'当前城市暂未开通此功能',3000,'warning');
}
//获取订单状态
$this->load->model("package_model");
$orderData = $this->package_model->getOrderInfoById($orderId);
//校验订单状态
if($orderData['user_id'] != $this->user_id || $orderData['order_status'] != 1 ){
return $this->jump(USER_CENTER ,'订单数据异常',3000,'warning');
}
//获取发票是否创建
$invoiceData = $this->package_model->getOrderInvoice($orderId);
if(!empty($invoiceData)){
return $this->jump(USER_CENTER ,'发票已经创建',3000,'warning');
}
//获取用户最新的发票信息
$oldInvoice = $this->package_model->getOrderInvoiceByUserId($this->user_id);
$oldInvoice['pic'] = !empty($oldInvoice['pic']) ? explode(',', $oldInvoice['pic']) : array();
$data['oldInvoice'] = $oldInvoice;
$data['orderData'] = $orderData;
$data['title'] = '发票在线填写';
$this->load->model("tel_model");
$data['telno_config'] = $this->tel_model->getTelInfoByType(tel_model::TYPE3);
$data['address_config'] = isset($this->address[GB_CITY]) ? $this->address[GB_CITY] : '';
$this->load->view('order_invoice',$data);
}
public function createOrderInvoice(){
if(GB_CITY != 'nj' && GB_CITY != 'wh'){
return;
}
$orderId = intval($this->input->post('order_id',true));
$userType = intval($this->input->post('user_type',true));
$type = intval($this->input->post('type',true));
$username = addslashes($this->input->post('username',true));
$identityCard = addslashes($this->input->post('identity_card',true));
$invoiceTitle = addslashes($this->input->post('invoice_title',true));
$invoiceNumber = addslashes($this->input->post('invoice_number',true));
$bank = addslashes($this->input->post('bank',true));
$phone = addslashes($this->input->post('phone',true));
$address = addslashes($this->input->post('address',true));
$sendType = addslashes($this->input->post('send_type',true));
$bankAccount = addslashes($this->input->post('bank_account',true));
$mailingUsername = addslashes($this->input->post('mailing_username',true));
$mailingAddress = addslashes($this->input->post('mailing_address',true));
$mailingPhone = addslashes($this->input->post('mailing_phone',true));
$picArr = $this->input->post('p_filename',true);
//参数判断
if(empty($orderId) || empty($type) || empty($userType) || empty($sendType)){
return $this->jump(USER_CENTER ,'参数缺失',3000,'warning');
}
if($userType == 1 && $type == 2){
return $this->jump(USER_CENTER ,'参数错误',3000,'warning');
}
if($userType == 1 && ( empty($username) || empty($identityCard))){
return $this->jump(USER_CENTER ,'参数缺失',3000,'warning');
}
if($userType == 2 && ( empty($invoiceTitle) || empty($invoiceNumber) ) ){
return $this->jump(USER_CENTER ,'参数缺失',3000,'warning');
}
if($type == 2 && ( empty($bank) || empty($phone) || empty($address) || empty($bankAccount) || empty($picArr)) ){
return $this->jump(USER_CENTER ,'参数缺失',3000,'warning');
}
if($sendType == 1 && ( empty($mailingUsername) || empty($mailingAddress) || empty($mailingPhone) ) ){
return $this->jump(USER_CENTER ,'参数缺失',3000,'warning');
}
//获取订单状态
$this->load->model("package_model");
$orderData = $this->package_model->getOrderInfoById($orderId);
//校验订单状态
if($orderData['user_id'] != $this->user_id || $orderData['pay_status'] != 1 || $orderData['order_status'] != 1 ){
return $this->jump(USER_CENTER ,'订单数据异常',3000,'warning');
}
//获取发票是否创建
$invoiceData = $this->package_model->getOrderInvoice($orderId);
if(!empty($invoiceData)){
return $this->jump(USER_CENTER ,'发票已经创建',3000,'warning');
}
$data = array();
$data['order_id'] = $orderId;
$data['type'] = $type;
$data['price'] = $orderData['price'];
$data['send_type'] = $sendType;
$data['user_type'] = $userType;
if($userType == 1){
$data['username'] = $username;
$data['identity_card'] = $identityCard;
}
if($userType == 2){
$data['invoice_title'] = $invoiceTitle;
$data['invoice_number'] = $invoiceNumber;
$pic = addslashes( implode(',',$picArr) );
$data['pic'] = $pic;
}
if($type == 2){
$data['bank'] = $bank;
$data['bank_account'] = $bankAccount;
$data['phone'] = $phone;
$data['address'] = $address;
}
if($sendType == 1){
$data['mailing_username'] = $mailingUsername;
$data['mailing_address'] = $mailingAddress;
$data['mailing_phone'] = $mailingPhone;
}
$invoiceId = $this->package_model->createOrderInvoice($data);
if($invoiceId <= 0){
return $this->jump(USER_CENTER ,'发票生成失败',3000,'warning');
}
//获取推广信息
$promoteData = $this->package_model->getPromoteByOrderId($orderId);
$promoteId = $promoteData['id'];
$updateData = array();
$updateData['invoice_id'] = $invoiceId;
$updateData['invoice_status'] = 0;
$where = array();
$where['id'] = $promoteId;
$this->package_model->updatePromote($updateData, $where);
return $this->jump(USER_CENTER);
}
/**
* form表单提示信息 2017-12-18
* @param string $url
* @param string $msg
* @param string $time
* @param string $type
*/
private function jump( $url = 'user.house365.com' , $msg = '提交成功', $time ='3000', $type = 'success'){
$data['msg'] = $msg;
$data['url'] = $url;
$data['time'] = $time;
$data['type'] = $type;
$this->load->view('form_alert',$data);
}
//我的订单
public function myorder(){
$data['conf_where'] = 'myorder';
$data['title'] = '我的订单';
$data['pagesize'] = 10;//记录每页的条数
$data['page'] = $this->uri->segment(3) ? intval($this->uri->segment(3)) :1 ; // 获取当前页数
$data['totalsize'] = $this->user_model->myorder_count($this->user_id);//记录总数
$data['totalpage'] = ceil($data['totalsize']/$data['pagesize']);
$orderdata = $this->user_model->myorder_list($this->user_id,$data['page'],$data['pagesize']);
$data['orders'] = $orderdata;
$this->load->view('myorder',$data);
}
//图形验证码
public function imageCode(){
$this->user_model->imageCode();
}
//图形验证码验证
public function imageCodeVerify(){
$re = $this->user_model->imageCodeVerify();
$re['msg'] = iconv('gbk','utf-8',$re['msg']);
echo json_encode($re);die;
}
//银行卡实名认证
public function bankCertify(){
$re = $this->user_model->bankCertify();
$re['msg'] = iconv('gbk','utf-8',$re['msg']);
if(!empty($re['data']['truename'])){
$re['data']['truename'] = iconv('gbk','utf-8',$re['data']['truename']);
}
echo json_encode($re);die;
}
}
\ No newline at end of file
...@@ -6,15 +6,14 @@ class User_Wang extends MY_Controller ...@@ -6,15 +6,14 @@ class User_Wang extends MY_Controller
function __construct() function __construct()
{ {
parent::__construct(); parent::__construct();
if($_GET['test'] == 'yh'){ if($_GET['test']){
echo 'yh';exit; echo 'ddddd';exit;
} }
$this->load->model("user_model"); $this->load->model("user_model");
$this->load->model("broker_model"); $this->load->model("broker_model");
$this->load->model("pic_model"); $this->load->model("pic_model");
$this->load->model("block_model"); $this->load->model("block_model");
$this->load->model("ask_model"); $this->load->model("ask_model");
...@@ -23,7 +22,9 @@ class User_Wang extends MY_Controller ...@@ -23,7 +22,9 @@ class User_Wang extends MY_Controller
$this->load->library("user_class"); $this->load->library("user_class");
$this->load->library("apply_class"); $this->load->library("apply_class");
$this->user_id = checklogin(); $this->user_id = checklogin();
if($_GET['test']){
echo 'ffff';exit;
}
if( $this->user_id <= 0 ) if( $this->user_id <= 0 )
{ {
jumpto( USER_CENTER.'login'); jumpto( USER_CENTER.'login');
...@@ -47,7 +48,7 @@ class User_Wang extends MY_Controller ...@@ -47,7 +48,7 @@ class User_Wang extends MY_Controller
public function index() public function index()
{ {
global $house; global $house;
$data['conf_where'] = 'index'; $data['conf_where'] = 'index';
$data['title'] = '会员中心'; $data['title'] = '会员中心';
$data['priceunit'] = $house['priceunit']; $data['priceunit'] = $house['priceunit'];
...@@ -59,7 +60,7 @@ class User_Wang extends MY_Controller ...@@ -59,7 +60,7 @@ class User_Wang extends MY_Controller
//获取最新2条房源 //获取最新2条房源
$newhouse = $this->user_model->newhouse( $this->user_id , 2 ); $newhouse = $this->user_model->newhouse( $this->user_id , 2 );
$data['newhouse'] = $newhouse; $data['newhouse'] = $newhouse;
$count_newhouse =count($newhouse); $count_newhouse =count($newhouse);
...@@ -75,7 +76,7 @@ class User_Wang extends MY_Controller ...@@ -75,7 +76,7 @@ class User_Wang extends MY_Controller
} }
$active_num++; $active_num++;
} }
} }
if(isset($_GET['test'])) if(isset($_GET['test']))
{ {
...@@ -90,22 +91,22 @@ class User_Wang extends MY_Controller ...@@ -90,22 +91,22 @@ class User_Wang extends MY_Controller
$data['rent_collect_house'] = $rent_collect_house; $data['rent_collect_house'] = $rent_collect_house;
$data['sell_collect_block'] = $sell_collect_block; $data['sell_collect_block'] = $sell_collect_block;
//获取你可能感兴趣的二手房 //获取你可能感兴趣的二手房
$data['likesell'] = $this->user_model->getlikehousebyrule($active_num,$active_sell_num,$newhouse,$sell_collect_house,$sell_collect_block,$this->user_id,'sell',$active_sell_num,4); $data['likesell'] = $this->user_model->getlikehousebyrule($active_num,$active_sell_num,$newhouse,$sell_collect_house,$sell_collect_block,$this->user_id,'sell',$active_sell_num,4);
//获取你可能感兴趣的租房 //获取你可能感兴趣的租房
$data['likerent'] = $this->user_model->getlikehousebyrule($active_num,$active_sell_num,$newhouse,$rent_collect_house,$sell_collect_block,$this->user_id,'rent',$active_sell_num,4); $data['likerent'] = $this->user_model->getlikehousebyrule($active_num,$active_sell_num,$newhouse,$rent_collect_house,$sell_collect_block,$this->user_id,'rent',$active_sell_num,4);
//获取你可能感兴趣的小区 //获取你可能感兴趣的小区
$data['likeblock'] = $this->user_model->getlikehousebyrule($active_num,$active_sell_num,$newhouse,$sell_collect_house,$sell_collect_block,$this->user_id,'block',4); $data['likeblock'] = $this->user_model->getlikehousebyrule($active_num,$active_sell_num,$newhouse,$sell_collect_house,$sell_collect_block,$this->user_id,'block',4);
//中奖通知 5.25-8.31 //中奖通知 5.25-8.31
$data['is_win'] = $this->_get_is_win(); $data['is_win'] = $this->_get_is_win();
//BI统计 ----- start-----> //BI统计 ----- start----->
$data['isa_website'] = '2,19,46'; $data['isa_website'] = '2,19,46';
$data['isa_city'] = GB_CITY; $data['isa_city'] = GB_CITY;
...@@ -114,7 +115,7 @@ class User_Wang extends MY_Controller ...@@ -114,7 +115,7 @@ class User_Wang extends MY_Controller
//BI统计 ----- ent-----> //BI统计 ----- ent----->
$this->load->view('index',$data); $this->load->view('index',$data);
} }
/** /**
* 会员中心切换城市 * 会员中心切换城市
* @author cxf * @author cxf
...@@ -155,24 +156,24 @@ class User_Wang extends MY_Controller ...@@ -155,24 +156,24 @@ class User_Wang extends MY_Controller
$data['collect'] = $this->user_model->getcollect(3,$this->user_id,$data['offset'],$data['pagesize']); $data['collect'] = $this->user_model->getcollect(3,$this->user_id,$data['offset'],$data['pagesize']);
if(is_array($data['collect'])&&!empty($data['collect'])){ if(is_array($data['collect'])&&!empty($data['collect'])){
foreach($data['collect'] as $key=>$value){ foreach($data['collect'] as $key=>$value){
if(GB_CITY=='nj') if(GB_CITY=='nj')
{ {
$isChoice = $this->user_model->isCheckPriceRemind($this->user_id,$value['collect_id']); $isChoice = $this->user_model->isCheckPriceRemind($this->user_id,$value['collect_id']);
$infofrom_data=$this->user_model->get_infofrom_by_id($value['collect_id']); $infofrom_data=$this->user_model->get_infofrom_by_id($value['collect_id']);
} }
$data['collect'][$key]['infofrom'] =$infofrom_data[0]['infofrom']; $data['collect'][$key]['infofrom'] =$infofrom_data[0]['infofrom'];
$data['collect'][$key]['is_remind'] = isset($isChoice[0]['status'])&&($isChoice[0]['status']==1) ? 1:0; $data['collect'][$key]['is_remind'] = isset($isChoice[0]['status'])&&($isChoice[0]['status']==1) ? 1:0;
} }
} }
//获取你可能感兴趣的二手房 //获取你可能感兴趣的二手房
$data['likesell'] = $this->user_model->getlikehouse($this->user_id,'sell',4); $data['likesell'] = $this->user_model->getlikehouse($this->user_id,'sell',4);
//BI统计 ----- start-----> //BI统计 ----- start----->
$data['isa_website'] = '2,19,79'; $data['isa_website'] = '2,19,79';
$data['isa_city'] = GB_CITY; $data['isa_city'] = GB_CITY;
$data['isa_addones'] = ''; $data['isa_addones'] = '';
...@@ -245,7 +246,7 @@ class User_Wang extends MY_Controller ...@@ -245,7 +246,7 @@ class User_Wang extends MY_Controller
$data['likeblock'] = $this->user_model->getlikehouse($this->user_id,'block',4); $data['likeblock'] = $this->user_model->getlikehouse($this->user_id,'block',4);
//BI统计 ----- start-----> //BI统计 ----- start----->
$data['isa_website'] = '2,19,80'; $data['isa_website'] = '2,19,80';
$data['isa_city'] = GB_CITY; $data['isa_city'] = GB_CITY;
$data['isa_addones'] = ''; $data['isa_addones'] = '';
...@@ -278,11 +279,11 @@ class User_Wang extends MY_Controller ...@@ -278,11 +279,11 @@ class User_Wang extends MY_Controller
$data['page'] = $this->uri->segment(3) ? intval($this->uri->segment(3)) :1 ; // 获取当前页数 $data['page'] = $this->uri->segment(3) ? intval($this->uri->segment(3)) :1 ; // 获取当前页数
$data['page'] = ($data['page']>$data['pages'] && $data['pages']!=0) ? $data['pages'] : $data['page']; //判断跳转页数 $data['page'] = ($data['page']>$data['pages'] && $data['pages']!=0) ? $data['pages'] : $data['page']; //判断跳转页数
$data['offset'] = $data['pagesize']*($data['page']-1); //计算记录偏移量 $data['offset'] = $data['pagesize']*($data['page']-1); //计算记录偏移量
$data['collect'] = $this->user_model->getCollectSchoolList(7,$this->user_id,$data['offset'],$data['pagesize']); $data['collect'] = $this->user_model->getCollectSchoolList(7,$this->user_id,$data['offset'],$data['pagesize']);
//获取你可能感兴趣的二手房 //获取你可能感兴趣的二手房
$data['likesell'] = $this->user_model->getLikeSchoolHouse($this->user_id); $data['likesell'] = $this->user_model->getLikeSchoolHouse($this->user_id);
//BI统计 ----- start-----> //BI统计 ----- start----->
$data['isa_website'] = '2,19,77'; $data['isa_website'] = '2,19,77';
$data['isa_city'] = GB_CITY; $data['isa_city'] = GB_CITY;
$data['isa_addones'] = ''; $data['isa_addones'] = '';
...@@ -322,7 +323,7 @@ class User_Wang extends MY_Controller ...@@ -322,7 +323,7 @@ class User_Wang extends MY_Controller
//获取当前页数 //获取当前页数
$data['page'] = $this->uri->segment(3) ? intval($this->uri->segment(3)) : 1 ; $data['page'] = $this->uri->segment(3) ? intval($this->uri->segment(3)) : 1 ;
//判断跳转页数 //判断跳转页数
$data['page'] = ($data['page']>$data['pages'] && $data['pages']!=0) ? $data['pages'] : $data['page']; $data['page'] = ($data['page']>$data['pages'] && $data['pages']!=0) ? $data['pages'] : $data['page'];
//计算记录偏移量 //计算记录偏移量
$data['offset'] = $data['pagesize']*($data['page']-1); $data['offset'] = $data['pagesize']*($data['page']-1);
$data['collect'] = $this->user_model->getcollect(1,$this->user_id,$data['offset'],$data['pagesize']); $data['collect'] = $this->user_model->getcollect(1,$this->user_id,$data['offset'],$data['pagesize']);
...@@ -333,7 +334,7 @@ class User_Wang extends MY_Controller ...@@ -333,7 +334,7 @@ class User_Wang extends MY_Controller
//BI统计 ----- start-----> //BI统计 ----- start----->
$data['isa_website'] = '2,19,78'; $data['isa_website'] = '2,19,78';
$data['isa_city'] = GB_CITY; $data['isa_city'] = GB_CITY;
$data['isa_addones'] = ''; $data['isa_addones'] = '';
...@@ -422,7 +423,7 @@ class User_Wang extends MY_Controller ...@@ -422,7 +423,7 @@ class User_Wang extends MY_Controller
*/ */
function edit_profile() function edit_profile()
{ {
$_SESSION['token'] = md5($this->user_id); $_SESSION['token'] = md5($this->user_id);
$data['js'] = '<script type="text/javascript" src="'.USER_CENTER.'js/jquery.Jcrop.min.js"></script>'; $data['js'] = '<script type="text/javascript" src="'.USER_CENTER.'js/jquery.Jcrop.min.js"></script>';
$data['conf_where'] = 'edit_profile'; $data['conf_where'] = 'edit_profile';
...@@ -447,7 +448,7 @@ class User_Wang extends MY_Controller ...@@ -447,7 +448,7 @@ class User_Wang extends MY_Controller
//BI统计 ----- start-----> //BI统计 ----- start----->
$data['isa_website'] = '2,19,83'; $data['isa_website'] = '2,19,83';
$data['isa_city'] = GB_CITY; $data['isa_city'] = GB_CITY;
$data['isa_addones'] = ''; $data['isa_addones'] = '';
...@@ -463,7 +464,7 @@ class User_Wang extends MY_Controller ...@@ -463,7 +464,7 @@ class User_Wang extends MY_Controller
*/ */
function edit_password() function edit_password()
{ {
$_SESSION['token'] = md5($this->user_id); $_SESSION['token'] = md5($this->user_id);
$data['js']= '<script type="text/javascript" src="'.USER_CENTER.'js/Validform_v5.3.2_ncr_min.js"></script>'; $data['js']= '<script type="text/javascript" src="'.USER_CENTER.'js/Validform_v5.3.2_ncr_min.js"></script>';
$select = array('telno'); $select = array('telno');
$data['user'] = $this->user_model->get_userdetail($this->user_id,$select); $data['user'] = $this->user_model->get_userdetail($this->user_id,$select);
...@@ -715,7 +716,7 @@ class User_Wang extends MY_Controller ...@@ -715,7 +716,7 @@ class User_Wang extends MY_Controller
$data['expertslist'] = $this->ask_model->getexperts(); $data['expertslist'] = $this->ask_model->getexperts();
//BI统计 ----- start-----> //BI统计 ----- start----->
$data['isa_website'] = '2,19,99'; $data['isa_website'] = '2,19,99';
$data['isa_city'] = GB_CITY; $data['isa_city'] = GB_CITY;
$data['isa_addones'] = ''; $data['isa_addones'] = '';
...@@ -771,7 +772,7 @@ class User_Wang extends MY_Controller ...@@ -771,7 +772,7 @@ class User_Wang extends MY_Controller
//BI统计 ----- start-----> //BI统计 ----- start----->
$data['isa_website'] = '2,19,82'; $data['isa_website'] = '2,19,82';
$data['isa_city'] = GB_CITY; $data['isa_city'] = GB_CITY;
$data['isa_addones'] = ''; $data['isa_addones'] = '';
...@@ -948,12 +949,12 @@ class User_Wang extends MY_Controller ...@@ -948,12 +949,12 @@ class User_Wang extends MY_Controller
$data['offset'] = $data['pagesize']*($data['page']-1); //计算记录偏移量 $data['offset'] = $data['pagesize']*($data['page']-1); //计算记录偏移量
//获取房源 //获取房源
$data['house_array'] = $this->house_model->gethousebyuid($this->user_id,'sell',array('id','address','buildarea','price','updatetime','creattime','esta','ischarge','pic1','district','streetid','blockshowname','infotype','room','hall','fitment','buildarea','ischarge','telno','floor ','subfloor','totalfloor'),$data['offset'],$data['pagesize']); $data['house_array'] = $this->house_model->gethousebyuid($this->user_id,'sell',array('id','address','buildarea','price','updatetime','creattime','esta','ischarge','pic1','district','streetid','blockshowname','infotype','room','hall','fitment','buildarea','ischarge','telno','floor ','subfloor','totalfloor'),$data['offset'],$data['pagesize']);
//中奖通知 5.25-8.31 //中奖通知 5.25-8.31
$data['is_win'] = $this->_get_is_win(); $data['is_win'] = $this->_get_is_win();
//BI统计 ----- start-----> //BI统计 ----- start----->
$data['isa_website'] = '2,19,72'; $data['isa_website'] = '2,19,72';
$data['isa_city'] = GB_CITY; $data['isa_city'] = GB_CITY;
$data['isa_addones'] = ''; $data['isa_addones'] = '';
...@@ -1109,16 +1110,16 @@ class User_Wang extends MY_Controller ...@@ -1109,16 +1110,16 @@ class User_Wang extends MY_Controller
$this->house_statistic_model->set_city(GB_CITY); $this->house_statistic_model->set_city(GB_CITY);
$result1 = $this->house_statistic_model->sub_operate_log('rent' , $id , 5 ); $result1 = $this->house_statistic_model->sub_operate_log('rent' , $id , 5 );
if($result>0) if($result>0)
{ {
//通知爱租哪 //通知爱租哪
if(GB_CITY == 'nj' || GB_CITY == 'hf') if(GB_CITY == 'nj' || GB_CITY == 'hf')
{ {
$houseData = $this->house_model->gethousebywhere(array('id' => $id),'rent',array('iszhizu'),1); $houseData = $this->house_model->gethousebywhere(array('id' => $id),'rent',array('iszhizu'),1);
if(!empty($houseData) && $houseData[0]['iszhizu'] == '1') if(!empty($houseData) && $houseData[0]['iszhizu'] == '1')
{ {
$url = 'http://mtapi.house365.com/?method=zhizu.ApiRent_syncEsf2AznStatus&city='.GB_CITY.'&id='.$id.'&esta=1&uid='.$this->user_id; $url = 'http://mtapi.house365.com/?method=zhizu.ApiRent_syncEsf2AznStatus&city='.GB_CITY.'&id='.$id.'&esta=1&uid='.$this->user_id;
curl_get_contents($url); curl_get_contents($url);
} }
} }
...@@ -1152,7 +1153,7 @@ class User_Wang extends MY_Controller ...@@ -1152,7 +1153,7 @@ class User_Wang extends MY_Controller
$data['is_win'] = $this->_get_is_win(); $data['is_win'] = $this->_get_is_win();
//BI统计 ----- start-----> //BI统计 ----- start----->
$data['isa_website'] = '2,19,73'; $data['isa_website'] = '2,19,73';
$data['isa_city'] = GB_CITY; $data['isa_city'] = GB_CITY;
$data['isa_addones'] = ''; $data['isa_addones'] = '';
...@@ -1162,8 +1163,8 @@ class User_Wang extends MY_Controller ...@@ -1162,8 +1163,8 @@ class User_Wang extends MY_Controller
$this->load->view('myhouserent_wang',$data); $this->load->view('myhouserent_wang',$data);
} }
/** /**
* 获取当前会员是否获取奖品 * 获取当前会员是否获取奖品
* *
...@@ -1177,14 +1178,14 @@ class User_Wang extends MY_Controller ...@@ -1177,14 +1178,14 @@ class User_Wang extends MY_Controller
$time = time(); $time = time();
$start_date = mktime(0,0,0,5,25,date('Y')); $start_date = mktime(0,0,0,5,25,date('Y'));
$end_date = mktime(23,59,59,12,23,date('Y')); $end_date = mktime(23,59,59,12,23,date('Y'));
if($start_date <= $time && $time <= $end_date) if($start_date <= $time && $time <= $end_date)
{ {
$user_data = $this->user_model->get_user_data($this->user_id); $user_data = $this->user_model->get_user_data($this->user_id);
if(!empty($user_data) && !empty($user_data['telno'])) if(!empty($user_data) && !empty($user_data['telno']))
{ {
$result = $this->user_model->check_is_win($this->user_id,$user_data['telno'],$start_date,$end_date); $result = $this->user_model->check_is_win($this->user_id,$user_data['telno'],$start_date,$end_date);
} }
} }
} }
...@@ -1192,48 +1193,48 @@ class User_Wang extends MY_Controller ...@@ -1192,48 +1193,48 @@ class User_Wang extends MY_Controller
return $result; return $result;
} }
//价格提醒处理ajax //价格提醒处理ajax
function price_remind_ajax(){ function price_remind_ajax(){
error_reporting(7); error_reporting(7);
ini_set("display_errors",true); ini_set("display_errors",true);
$this->load->model("user_model"); $this->load->model("user_model");
$houseid = $this->input->post('houseid'); $houseid = $this->input->post('houseid');
$type = $this->input->post('type'); $type = $this->input->post('type');
$flag = $this->input->post('flag'); $flag = $this->input->post('flag');
$priceRemindNum = $this->user_model->getPriceRemindNum($this->user_id); $priceRemindNum = $this->user_model->getPriceRemindNum($this->user_id);
if($priceRemindNum>=5&&$flag==1){//满4条提示 if($priceRemindNum>=5&&$flag==1){//满4条提示
$result = 3; $result = 3;
}else{ }else{
$isChoice = $this->user_model->isCheckPriceRemind($this->user_id,$houseid); $isChoice = $this->user_model->isCheckPriceRemind($this->user_id,$houseid);
//var_dump($isChoice);exit(); //var_dump($isChoice);exit();
if(is_array($isChoice)){ if(is_array($isChoice)){
if(empty($isChoice)&&$flag==1){ if(empty($isChoice)&&$flag==1){
$result = $this->user_model->addPriceRemind($houseid,$this->user_id); $result = $this->user_model->addPriceRemind($houseid,$this->user_id);
//echo "444"; //echo "444";
}elseif($isChoice[0]['status']==1&&$flag==0){ }elseif($isChoice[0]['status']==1&&$flag==0){
$result = $this->user_model->updatePrcieRemind($houseid,$this->user_id,0); $result = $this->user_model->updatePrcieRemind($houseid,$this->user_id,0);
}elseif($isChoice[0]['status']==0&&$flag==1){ }elseif($isChoice[0]['status']==0&&$flag==1){
$result = $this->user_model->updatePrcieRemind($houseid,$this->user_id,1); $result = $this->user_model->updatePrcieRemind($houseid,$this->user_id,1);
} }
} }
} }
echo $result = $result ? $result :0; echo $result = $result ? $result :0;
} }
function test(){ function test(){
teste(); teste();
} }
} }
\ No newline at end of file
...@@ -9,20 +9,20 @@ ...@@ -9,20 +9,20 @@
<!----> <!---->
<div class="user-nav-mod user-nav-mod-auto"> <div class="user-nav-mod user-nav-mod-auto">
<div class="user-nav-mod"> <a href="javascript:void(0)" class="nav0 js_show_nav"><span class="tex"><strong class="s_h js_s_h <?php if($conf_where=='selllist' || $conf_where=='blocklist' || $conf_where=='sell_condition') echo 's_h_on';?>">我的关注</strong></span></a> </div> <div class="user-nav-mod"> <a href="javascript:void(0)" class="nav0 js_show_nav"><span class="tex"><strong class="s_h js_s_h <?php if($conf_where=='selllist' || $conf_where=='blocklist' || $conf_where=='sell_condition') echo 's_h_on';?>">我的收藏</strong></span></a> </div>
<div class="show_nav_mod js_show_nav_mod" <?php if($conf_where=='selllist' || $conf_where=='blocklist' ||$conf_where=='schoollist' || $conf_where=='sell_condition' || $conf_where == 'officelist' || $conf_where == 'brandlist') echo 'style="display: block;"';?>> <div class="show_nav_mod js_show_nav_mod" <?php if($conf_where=='selllist' || $conf_where=='blocklist' ||$conf_where=='schoollist' || $conf_where=='sell_condition' || $conf_where == 'officelist' || $conf_where == 'brandlist') echo 'style="display: block;"';?>>
<div class="user-nav-mod <?php if($conf_where=='selllist') echo 'on';?>"> <a href="<?php echo USER_CENTER.'user/selllist';?>" class="innerLink">关注的房源</a> </div> <div class="user-nav-mod <?php if($conf_where=='selllist') echo 'on';?>"> <a href="<?php echo USER_CENTER.'user/selllist';?>" class="innerLink">收藏的房源</a> </div>
<div class="user-nav-mod <?php if($conf_where=='blocklist') echo 'on';?>"> <a href="<?php echo USER_CENTER.'user/blocklist';?>" class="innerLink">关注的小区</a> </div> <div class="user-nav-mod <?php if($conf_where=='blocklist') echo 'on';?>"> <a href="<?php echo USER_CENTER.'user/blocklist';?>" class="innerLink">收藏的小区</a> </div>
<?php if(GB_CITY=='nj'){?> <?php if(GB_CITY=='nj'){?>
<div class="user-nav-mod <?php if($conf_where=='officelist' || $conf_where=='brandlist') echo 'on';?>"> <a href="<?php echo USER_CENTER.'user/officelist';?>" class="innerLink">关注的楼盘</a> </div> <div class="user-nav-mod <?php if($conf_where=='officelist' || $conf_where=='brandlist') echo 'on';?>"> <a href="<?php echo USER_CENTER.'user/officelist';?>" class="innerLink">收藏的写字楼</a> </div>
<?php } ?> <?php } ?>
<?php if(GB_CITY=='nj' || GB_CITY=='hf' || GB_CITY=='wh'){?> <?php if(GB_CITY=='nj' || GB_CITY=='hf' || GB_CITY=='wh'){?>
<div class="user-nav-mod <?php if($conf_where=='schoollist') echo 'on';?>"> <a href="<?php echo USER_CENTER.'user/schoollist';?>" class="innerLink">关注的学校</a> </div> <div class="user-nav-mod <?php if($conf_where=='schoollist') echo 'on';?>"> <a href="<?php echo USER_CENTER.'user/schoollist';?>" class="innerLink">关注的学校</a> </div>
<?php }?> <?php }?>
<div class="user-nav-mod user-nav-mod-last <?php if($conf_where=='sell_condition') echo 'on';?>"> <a href="<?php echo USER_CENTER.'user/sell_condition';?>" class="innerLink">关注的找房条件</a> </div> <div class="user-nav-mod user-nav-mod-last <?php if($conf_where=='sell_condition') echo 'on';?>"> <a href="<?php echo USER_CENTER.'user/sell_condition';?>" class="innerLink">关注的找房条件</a> </div>
<div class="user-nav-mod "> <a href="<?php echo GB_NEW_HOUSE_COLLECT_URL;?>" class="innerLink">楼盘收藏</a> </div> <div class="user-nav-mod "> <a href="<?php echo GB_NEW_HOUSE_COLLECT_URL;?>" class="innerLink">收藏的楼盘</a> </div>
</div> </div>
</div> </div>
...@@ -70,8 +70,8 @@ ...@@ -70,8 +70,8 @@
<div class="user-nav-mod <?php if($conf_where=='edit_profile') echo 'on';?>"> <a href="<?php echo USER_CENTER.'user/edit_profile';?>" class="innerLink">修改资料</a> </div> <div class="user-nav-mod <?php if($conf_where=='edit_profile') echo 'on';?>"> <a href="<?php echo USER_CENTER.'user/edit_profile';?>" class="innerLink">修改资料</a> </div>
<!-- <div class="user-nav-mod --><?php //if($conf_where=='edit_password') echo 'on';?><!--"> <a href="--><?php //echo USER_CENTER.'user/edit_password';?><!--" class="innerLink">修改密码</a> </div>--> <!-- <div class="user-nav-mod --><?php //if($conf_where=='edit_password') echo 'on';?><!--"> <a href="--><?php //echo USER_CENTER.'user/edit_password';?><!--" class="innerLink">修改密码</a> </div>-->
<!-- <div class="user-nav-mod user-nav-mod-last --><?php //if($conf_where=='edit_telno') echo 'on';?><!--"> <a href="--><?php //echo USER_CENTER.'user/edit_telno';?><!--" class="innerLink">修改手机号码</a> </div>--> <!-- <div class="user-nav-mod user-nav-mod-last --><?php //if($conf_where=='edit_telno') echo 'on';?><!--"> <a href="--><?php //echo USER_CENTER.'user/edit_telno';?><!--" class="innerLink">修改手机号码</a> </div>-->
<div class="user-nav-mod <?php if($conf_where=='edit_password') echo 'on';?>"> <a href="<?php echo GB_EDIT_PHONE_URL;?>" class="innerLink">修改密码</a> </div> <div class="user-nav-mod <?php if($conf_where=='edit_password') echo 'on';?>"> <a href="<?php echo GB_EDIT_PWD_URL;?>" class="innerLink">修改密码</a> </div>
<div class="user-nav-mod user-nav-mod-last <?php if($conf_where=='edit_telno') echo 'on';?>"> <a href="<?php echo GB_EDIT_PWD_URL;?>" class="innerLink">修改手机号码</a> </div> <div class="user-nav-mod user-nav-mod-last <?php if($conf_where=='edit_telno') echo 'on';?>"> <a href="<?php echo GB_EDIT_PHONE_URL;?>" class="innerLink">修改手机号码</a> </div>
</div> </div>
</div> </div>
......
...@@ -82,12 +82,12 @@ ...@@ -82,12 +82,12 @@
<script> <script>
function buyListGuidePop(){ function buyListGuidePop(){
$("#myAskGuidePop").css({ $("#myAskGuidePop").css({
"display":"block", // "display":"block",
"width":$(window).width() < 960 ? 960 : $(window).width() +"px", "width":$(window).width() < 960 ? 960 : $(window).width() +"px",
"height":$(document).height()+"px" "height":$(document).height()+"px"
}); });
$("#myAskGuide").css({ $("#myAskGuide").css({
"display":"block", // "display":"block",
"left":$(".mod-list").offset().left - 25 +"px", "left":$(".mod-list").offset().left - 25 +"px",
"top":$(".mod-list").offset().top - 74 +"px" "top":$(".mod-list").offset().top - 74 +"px"
}); });
......
...@@ -8,6 +8,11 @@ ...@@ -8,6 +8,11 @@
.user-nav a.nav7 {background-position: 13px -695px;} .user-nav a.nav7 {background-position: 13px -695px;}
.user-nav-mod.on a.nav7{background-position: 13px -763px;background-color: #fff;} .user-nav-mod.on a.nav7{background-position: 13px -763px;background-color: #fff;}
.mt10{ margin-top: 10px;} .mt10{ margin-top: 10px;}
/** 二维码 **/
.qr_code{width: 100%;text-align: center;margin-top: 20px;}
.qr_code .title{font-size: 15px;color: #333333;margin-bottom: 30px;font-weight: bold;}
.qr_code .content img{width: 210px;}
</style> </style>
<div class="w960 clearfix mt10 pepcenterBox"> <div class="w960 clearfix mt10 pepcenterBox">
<?php require APPPATH_MVC.'views/left.php'; ?> <?php require APPPATH_MVC.'views/left.php'; ?>
...@@ -21,6 +26,13 @@ ...@@ -21,6 +26,13 @@
<div class="user-main user-main03 mt10"> <div class="user-main user-main03 mt10">
<div class="mod-list statistical"> <div class="mod-list statistical">
<div class="qr_code">
<div class="title">请使用微信扫描下方二维码</div>
<div class="content">
<img src="<?=$qrImg?>"/>
</div>
</div>
<?php if(1==2){?>
<?php if(count($orders)>0){ ?> <?php if(count($orders)>0){ ?>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="table-style-a acenter"> <table width="100%" border="0" cellspacing="0" cellpadding="0" class="table-style-a acenter">
<tr> <tr>
...@@ -66,6 +78,7 @@ ...@@ -66,6 +78,7 @@
<div class="no-result">目前您还没有订单哦。</div> <div class="no-result">目前您还没有订单哦。</div>
</div> </div>
<?php }?> <?php }?>
<?php } ?>
</div> </div>
</div> </div>
</form> </form>
......
<?php require APPPATH_MVC.'views/header.php'; ?>
<div class="paysuc popw" >
<div class="release-failBack">
</div>
<div class="release-fail yz-pop">
<div class="tit">
<span>支付成功 </span>
<div class="closes"></div>
</div>
<div class="poplist">
<div class="pstit">支付成功</div>
<div class="f16 c3 mt20">前往 <a href="<?php echo USER_CENTER; ?>" class="orange">个人中心>></a></div>
<div class="f14 c3 mt10" >支付金额:<span class="bold red"><?=$orderData['price']?></span>
<a href="<?php echo USER_CENTER.'user/orderInvoice/'.$orderData['id']?>">
<span class="f14 oranget hand">我要开发票</span>
</a>
</div>
</div>
<p>重要提醒:不点陌生链接、不泄露银行卡和验证码信息,谨防诈骗!</p>
</div>
</div>
<!--2017-11-28 end-->
<?php require APPPATH_MVC.'views/footer.php'; ?>
...@@ -413,6 +413,14 @@ define('GB_UCENTER_LOGIN_URL', 'https://ucenter.house365.com/index/login'); ...@@ -413,6 +413,14 @@ define('GB_UCENTER_LOGIN_URL', 'https://ucenter.house365.com/index/login');
define('GB_NEWRENT_INDEX_URL', 'http://newrent.house365.com/sell/index'); define('GB_NEWRENT_INDEX_URL', 'http://newrent.house365.com/sell/index');
// 退出地址 // 退出地址
define('GB_LOGOUT_URL', 'http://passport.house365.com/index/logout'); define('GB_LOGOUT_URL', 'http://passport.house365.com/index/logout');
// 验证优惠券
define('GB_CHECK_COUPON_URL', 'http://newrent.house365.com/api/tf-app/check-coupon-personal');
// 使用优惠券
define('GB_USE_COUPON_URL', 'http://newrent.house365.com/api/tf-app/use-coupon');
// 更新状态接口地址
define('GB_UPDATE_COUPON_URL', 'http://newrent.house365.com/api/tf-app/update-coupon-status');
// 添加日志
define('GB_ADD_LOG_URL', 'http://newrent.house365.com/api/tf-app/add-log');
if($_SERVER['SERVER_ADDR'] == '192.168.105.106') if($_SERVER['SERVER_ADDR'] == '192.168.105.106')
{ {
...@@ -555,7 +563,8 @@ $conf_house['nj']= array( ...@@ -555,7 +563,8 @@ $conf_house['nj']= array(
//担保所用区属 //担保所用区属
"dist" => array ('玄武区'=>'玄武区','鼓楼区'=>'鼓楼区', '白下区'=>'白下区','建邺区'=>'建邺区','秦淮区'=>'秦淮区', '下关区'=>'下关区','雨花台区'=>'雨花台区','栖霞区'=>'栖霞区', '江宁区'=>'江宁区','浦口区'=>'浦口区','六合区'=>'六合区','大厂区'=>'大厂区','溧水县'=>'溧水县', '高淳县'=>'高淳县'), "dist" => array ('玄武区'=>'玄武区','鼓楼区'=>'鼓楼区', '白下区'=>'白下区','建邺区'=>'建邺区','秦淮区'=>'秦淮区', '下关区'=>'下关区','雨花台区'=>'雨花台区','栖霞区'=>'栖霞区', '江宁区'=>'江宁区','浦口区'=>'浦口区','六合区'=>'六合区','大厂区'=>'大厂区','溧水县'=>'溧水县', '高淳县'=>'高淳县'),
"price_sell" => array('1'=>'40万以下','2'=>'40-60万','3'=>'60-90万','4'=>'90-120万','5'=>'120-150万','6'=>'150-200万','7'=>'200-300万','8'=>'300-500万','9'=>'500万以上'), "price_sell" => array('1'=>'40万以下','2'=>'40-60万','3'=>'60-90万','4'=>'90-120万','5'=>'120-150万','6'=>'150-200万','7'=>'200-300万','8'=>'300-500万','9'=>'500万以上'),
"buildarea" => array('1'=>'40㎡以下','2'=>'40-60㎡','3'=>'60-80㎡','4'=>'80-100㎡','5'=>'100-120㎡','6'=>'120-140㎡','7'=>'140-200㎡','8'=>'200-400㎡','9'=>'400㎡以上'), "buildarea" => array('1'=>'50㎡以下','2'=>'50-80㎡','3'=>'80-100㎡','4'=>'100-120㎡','5'=>'120-150㎡','6'=>'150-200㎡','7'=>'200-300㎡','8'=>'300㎡以上'),
"rent_buildarea" => array('1'=>'50㎡以下','2'=>'50-100㎡','3'=>'100-200㎡','4'=>'200-300㎡','5'=>'300-500㎡','6'=>'500-1000㎡','7'=>'1000㎡以上'),
"price_rent" => array('1'=>'800元以下','2'=>'800-1200元','3'=>'1200-2000元','4'=>'2000-3000元','5'=>'3000-5000元','6'=>'5000-10000元','7'=>'10000元以上'), "price_rent" => array('1'=>'800元以下','2'=>'800-1200元','3'=>'1200-2000元','4'=>'2000-3000元','5'=>'3000-5000元','6'=>'5000-10000元','7'=>'10000元以上'),
//写字楼价格 //写字楼价格
"price_office" => array('1'=>'1元/平米*天以下','2'=>'1-2元','3'=>' 2-3元','4'=>'3-4元','5'=>' 4-5元','6'=>'5-7元','7'=>'7-9元','8'=>'9-12元','9'=>'12元/平米*天以上'), "price_office" => array('1'=>'1元/平米*天以下','2'=>'1-2元','3'=>' 2-3元','4'=>'3-4元','5'=>' 4-5元','6'=>'5-7元','7'=>'7-9元','8'=>'9-12元','9'=>'12元/平米*天以上'),
...@@ -567,7 +576,8 @@ $conf_house['nj']= array( ...@@ -567,7 +576,8 @@ $conf_house['nj']= array(
$conf_house['wx']= array( $conf_house['wx']= array(
"district" => array ('滨湖区'=>'滨湖区','惠山区'=>'惠山区', '锡山区'=>'锡山区','梁溪区'=>'梁溪区','新吴区'=>'新吴区','其他'=>'其他'), "district" => array ('滨湖区'=>'滨湖区','惠山区'=>'惠山区', '锡山区'=>'锡山区','梁溪区'=>'梁溪区','新吴区'=>'新吴区','其他'=>'其他'),
"price_sell" => array('1'=>'40万以下','2'=>'40-60万','3'=>'60-90万','4'=>'90-120万','5'=>'120-150万','6'=>'150-200万','7'=>'200-300万','8'=>'300-500万','9'=>'500万以上'), "price_sell" => array('1'=>'40万以下','2'=>'40-60万','3'=>'60-90万','4'=>'90-120万','5'=>'120-150万','6'=>'150-200万','7'=>'200-300万','8'=>'300-500万','9'=>'500万以上'),
"buildarea" => array('1'=>'50平米以下','2'=>'50-70平米','3'=>'70-90平米','4'=>'90-110平米','5'=>'110-144平米','6'=>'144-200平米','7'=>'200-400平米','8'=>'400平米以上'), "buildarea" => array('1'=>'50平米以下','2'=>'50-80平米','3'=>'80-100平米','4'=>'100-120平米','5'=>'120-150平米','6'=>'150-200平米','7'=>'200-300平米','8'=>'300平米以上'),
"rent_buildarea" => array('1'=>'50平米以下','2'=>'50-80平米','3'=>'80-100平米','4'=>'100-120平米','5'=>'120-150平米','6'=>'150-200平米','7'=>'200-300平米','8'=>'300平米以上'),
"price_rent" => array('1'=>'800元以下','2'=>'800-1200元','3'=>'1200-2000元','4'=>'2000-3000元','5'=>'3000-5000元','6'=>'5000-10000元','7'=>'10000元以上'), "price_rent" => array('1'=>'800元以下','2'=>'800-1200元','3'=>'1200-2000元','4'=>'2000-3000元','5'=>'3000-5000元','6'=>'5000-10000元','7'=>'10000元以上'),
//写字楼价格 //写字楼价格
"price_office" => array('1'=>'5000元以下','2'=>'5000-8000元','3'=>'8000-1万元','4'=>'1-1.5万','5'=>'1.5-2万','6'=>'2-5万','7'=>'5万以上'), "price_office" => array('1'=>'5000元以下','2'=>'5000-8000元','3'=>'8000-1万元','4'=>'1-1.5万','5'=>'1.5-2万','6'=>'2-5万','7'=>'5万以上'),
...@@ -589,7 +599,8 @@ $conf_house['cq']= array( ...@@ -589,7 +599,8 @@ $conf_house['cq']= array(
$conf_house['cz']= array( $conf_house['cz']= array(
"district" => array ('天宁'=>'天宁','钟楼'=>'钟楼','武进'=>'武进', '新北'=>'新北','戚墅堰'=>'戚墅堰','金坛'=>'金坛','溧阳'=>'溧阳','常州周边'=>'常州周边'), "district" => array ('天宁'=>'天宁','钟楼'=>'钟楼','武进'=>'武进', '新北'=>'新北','戚墅堰'=>'戚墅堰','金坛'=>'金坛','溧阳'=>'溧阳','常州周边'=>'常州周边'),
"price_sell" => array('1'=>'50万以下','2'=>'50-80万','3'=>'80-100万','4'=>'100-120万','5'=>'120-150万','6'=>'150-200万','7'=>'200-300万','8'=>'300万以上'), "price_sell" => array('1'=>'50万以下','2'=>'50-80万','3'=>'80-100万','4'=>'100-120万','5'=>'120-150万','6'=>'150-200万','7'=>'200-300万','8'=>'300万以上'),
"buildarea" => array('1'=>'60平米以下','2'=>'60-80平米','3'=>'80-100平米','4'=>'100-120平米','5'=>'120-150平米','6'=>'150平米以上'), "buildarea" => array('1'=>'50㎡以下','2'=>'50-80㎡','3'=>'80-100㎡','4'=>'100-120㎡','5'=>'120-150㎡','6'=>'150-200㎡','7'=>'200-300㎡','8'=>'300㎡以上'),
"rent_buildarea" => array('1'=>'50㎡以下','2'=>'50-100㎡','3'=>'100-200㎡','4'=>'200-300㎡','5'=>'300-500㎡','6'=>'500-1000㎡','7'=>'1000㎡以上'),
"price_rent" => array('1'=>'500元以下','2'=>'500-1000元','3'=>'1000-2000元','4'=>'2000-3000元','5'=>'3000-5000元','6'=>'5000元以上'), "price_rent" => array('1'=>'500元以下','2'=>'500-1000元','3'=>'1000-2000元','4'=>'2000-3000元','5'=>'3000-5000元','6'=>'5000元以上'),
//写字楼价格 //写字楼价格
"price_office" => array('1'=>'5000元以下','2'=>'5000-8000元','3'=>'8000-1万元','4'=>'1-1.5万','5'=>'1.5-2万','6'=>'2-5万','7'=>'5万以上'), "price_office" => array('1'=>'5000元以下','2'=>'5000-8000元','3'=>'8000-1万元','4'=>'1-1.5万','5'=>'1.5-2万','6'=>'2-5万','7'=>'5万以上'),
...@@ -614,7 +625,8 @@ $conf_house['hf']= array( ...@@ -614,7 +625,8 @@ $conf_house['hf']= array(
$conf_house['hz']= array( $conf_house['hz']= array(
"district" => array ('上城区'=>'上城区','下城区'=>'下城区', '江干区'=>'江干区','拱墅区'=>'拱墅区','西湖区'=>'西湖区','滨江区'=>'滨江区','余杭区'=>'余杭区','萧山区'=>'萧山区','富阳市'=>'富阳市','临安市'=>'临安市','建德市'=>'建德市','桐庐县'=>'桐庐县','淳安县'=>'淳安县','其他'=>'其他'), "district" => array ('上城区'=>'上城区','下城区'=>'下城区', '江干区'=>'江干区','拱墅区'=>'拱墅区','西湖区'=>'西湖区','滨江区'=>'滨江区','余杭区'=>'余杭区','萧山区'=>'萧山区','富阳市'=>'富阳市','临安市'=>'临安市','建德市'=>'建德市','桐庐县'=>'桐庐县','淳安县'=>'淳安县','其他'=>'其他'),
"price_sell" => array('1'=>'40万以下','2'=>'40-60万','3'=>'60-90万','4'=>'90-120万','5'=>'120-150万','6'=>'150-200万','7'=>'200-300万','8'=>'300-500万','9'=>'500万以上'), "price_sell" => array('1'=>'40万以下','2'=>'40-60万','3'=>'60-90万','4'=>'90-120万','5'=>'120-150万','6'=>'150-200万','7'=>'200-300万','8'=>'300-500万','9'=>'500万以上'),
"buildarea" => array('1'=>'40平米以下','2'=>'40-60平米','3'=>'60-80平米','4'=>'80-100平米','5'=>'100-120平米','6'=>'120-144平米','7'=>'144-200平米','8'=>'200-400平米','9'=>'400平米以上'), "buildarea" => array('1'=>'50㎡以下','2'=>'50-80㎡','3'=>'80-100㎡','4'=>'100-120㎡','5'=>'120-150㎡','6'=>'150-200㎡','7'=>'200-300㎡','8'=>'300㎡以上'),
"rent_buildarea" => array('1'=>'50㎡以下','2'=>'50-100㎡','3'=>'100-200㎡','4'=>'200-300㎡','5'=>'300-500㎡','6'=>'500-1000㎡','7'=>'1000㎡以上'),
"totalf" => array('1'=>'多层','2'=>'小高层','3'=>'高层','4'=>'复式'), "totalf" => array('1'=>'多层','2'=>'小高层','3'=>'高层','4'=>'复式'),
"price_rent" => array('1'=>'800元以下','2'=>'800-1200元','3'=>'1200-2000元','4'=>'2000-3000元','5'=>'3000-5000元','6'=>'5000-10000元','7'=>'10000元以上'), "price_rent" => array('1'=>'800元以下','2'=>'800-1200元','3'=>'1200-2000元','4'=>'2000-3000元','5'=>'3000-5000元','6'=>'5000-10000元','7'=>'10000元以上'),
//写字楼价格 //写字楼价格
...@@ -637,7 +649,8 @@ $conf_house['ks']= array( ...@@ -637,7 +649,8 @@ $conf_house['ks']= array(
$conf_house['sy']= array( $conf_house['sy']= array(
"district" => array ('大东'=>'大东','东陵'=>'东陵','和平'=>'和平', '皇姑'=>'皇姑','浑南新区'=>'浑南新区','苏家屯'=>'苏家屯','沈北新区'=>'沈北新区','沈河'=>'沈河','铁西'=>'铁西','于洪'=>'于洪','新民'=>'新民','辽中'=>'辽中','其他'=>'其他'), "district" => array ('大东'=>'大东','东陵'=>'东陵','和平'=>'和平', '皇姑'=>'皇姑','浑南新区'=>'浑南新区','苏家屯'=>'苏家屯','沈北新区'=>'沈北新区','沈河'=>'沈河','铁西'=>'铁西','于洪'=>'于洪','新民'=>'新民','辽中'=>'辽中','其他'=>'其他'),
"price_sell" => array('1'=>'30万以下','2'=>'30-50万','3'=>'50-80万','4'=>'80-120万','5'=>'120-150万','6'=>'150-200万','7'=>'200万以上'), "price_sell" => array('1'=>'30万以下','2'=>'30-50万','3'=>'50-80万','4'=>'80-120万','5'=>'120-150万','6'=>'150-200万','7'=>'200万以上'),
"buildarea" => array('1'=>'50平米以下','2'=>'50-80平米','3'=>'80-120平米','4'=>'120-140平米','5'=>'140-200平米','6'=>'200-300平米','7'=>'300平米以上'), "buildarea" => array('1'=>'50㎡以下','2'=>'50-80㎡','3'=>'80-100㎡','4'=>'100-120㎡','5'=>'120-150㎡','6'=>'150-200㎡','7'=>'200-300㎡','8'=>'300㎡以上'),
"rent_buildarea" => array('1'=>'50㎡以下','2'=>'50-100㎡','3'=>'100-200㎡','4'=>'200-300㎡','5'=>'300-500㎡','6'=>'500-1000㎡','7'=>'1000㎡以上'),
"price_rent" => array('1'=>'800元以下','2'=>'800-1200元','3'=>'1200-1800元','4'=>'1800-2200元','5'=>'2200-3000元','6'=>'3000-5000元','7'=>'5000元以上'), "price_rent" => array('1'=>'800元以下','2'=>'800-1200元','3'=>'1200-1800元','4'=>'1800-2200元','5'=>'2200-3000元','6'=>'3000-5000元','7'=>'5000元以上'),
"floortypesell" => array ('1'=>'任意','2'=>'1层','3'=>'2-5层','4'=>'6-12层','5'=>'13层以上') "floortypesell" => array ('1'=>'任意','2'=>'1层','3'=>'2-5层','4'=>'6-12层','5'=>'13层以上')
); );
...@@ -645,7 +658,8 @@ $conf_house['sy']= array( ...@@ -645,7 +658,8 @@ $conf_house['sy']= array(
$conf_house['sz']= array( $conf_house['sz']= array(
"district" => array ('园区' => '园区', '姑苏区' => '姑苏区', '新区' => '新区', '吴中区' => '吴中区', '相城区' => '相城区', '吴江' => '吴江', '昆山' => '昆山', '太仓' => '太仓', '常熟' => '常熟', '张家港' => '张家港'), "district" => array ('园区' => '园区', '姑苏区' => '姑苏区', '新区' => '新区', '吴中区' => '吴中区', '相城区' => '相城区', '吴江' => '吴江', '昆山' => '昆山', '太仓' => '太仓', '常熟' => '常熟', '张家港' => '张家港'),
"price_sell" => array('1'=>'40万以下','2'=>'40-60万','3'=>'60-90万','4'=>'90-120万','5'=>'120-150万','6'=>'150-200万','7'=>'200-300万','8'=>'300-500万','9'=>'500万以上'), "price_sell" => array('1'=>'40万以下','2'=>'40-60万','3'=>'60-90万','4'=>'90-120万','5'=>'120-150万','6'=>'150-200万','7'=>'200-300万','8'=>'300-500万','9'=>'500万以上'),
"buildarea" => array('1'=>'40平米以下','2'=>'40-60平米','3'=>'60-80平米','4'=>'80-100平米','5'=>'100-120平米','6'=>'120-144平米','7'=>'144-200平米','8'=>'200-400平米','9'=>'400平米以上'), "buildarea" => array('1'=>'50㎡以下','2'=>'50-80㎡','3'=>'80-100㎡','4'=>'100-120㎡','5'=>'120-150㎡','6'=>'150-200㎡','7'=>'200-300㎡','8'=>'300㎡以上'),
"rent_buildarea" => array('1'=>'50㎡以下','2'=>'50-100㎡','3'=>'100-200㎡','4'=>'200-300㎡','5'=>'300-500㎡','6'=>'500-1000㎡','7'=>'1000㎡以上'),
"price_rent" => array('1'=>'800元以下','2'=>'800-1400元','3'=>'1400-2000元','4'=>'2000-3000元'), "price_rent" => array('1'=>'800元以下','2'=>'800-1400元','3'=>'1400-2000元','4'=>'2000-3000元'),
"roomtype"=>array('1'=>'一室','2'=>'二室','3'=>'三室','4'=>'四室','5'=>'五室'), "roomtype"=>array('1'=>'一室','2'=>'二室','3'=>'三室','4'=>'四室','5'=>'五室'),
//写字楼价格 //写字楼价格
...@@ -658,7 +672,8 @@ $conf_house['sz']= array( ...@@ -658,7 +672,8 @@ $conf_house['sz']= array(
$conf_house['wh']= array( $conf_house['wh']= array(
"district" => array ('镜湖区'=>'镜湖区','鸠江区'=>'鸠江区', '弋江区'=>'弋江区','三山区'=>'三山区','开发区'=>'开发区', '芜湖县'=>'芜湖县','繁昌县'=>'繁昌县','南陵县'=>'南陵县','无为县'=>'无为县'), "district" => array ('镜湖区'=>'镜湖区','鸠江区'=>'鸠江区', '弋江区'=>'弋江区','三山区'=>'三山区','开发区'=>'开发区', '芜湖县'=>'芜湖县','繁昌县'=>'繁昌县','南陵县'=>'南陵县','无为县'=>'无为县'),
"price_sell" => array('1'=>'30万以下','2'=>'30-50万','3'=>'50-60万','4'=>'60-70万','5'=>'70-80万','6'=>'80-100万','7'=>'100-120万','8'=>'120-150万','9'=>'150万以上'), "price_sell" => array('1'=>'30万以下','2'=>'30-50万','3'=>'50-60万','4'=>'60-70万','5'=>'70-80万','6'=>'80-100万','7'=>'100-120万','8'=>'120-150万','9'=>'150万以上'),
"buildarea" => array('1'=>'60平米以下','2'=>'60-80平米','3'=>'80-100平米','4'=>'100-120平米','5'=>'120-150平米','6'=>'150平米以上'), "buildarea" => array('1'=>'50㎡以下','2'=>'50-80㎡','3'=>'80-100㎡','4'=>'100-120㎡','5'=>'120-150㎡','6'=>'150-200㎡','7'=>'200-300㎡','8'=>'300㎡以上'),
"rent_buildarea" => array('1'=>'50㎡以下','2'=>'50-100㎡','3'=>'100-200㎡','4'=>'200-300㎡','5'=>'300-500㎡','6'=>'500-1000㎡','7'=>'1000㎡以上'),
"price_rent" => array('1'=>'500元以下','2'=>'500-800元','3'=>'800-1500元','4'=>'1500-2500元','5'=>'2500-4000元','6'=>'4000元以上'), "price_rent" => array('1'=>'500元以下','2'=>'500-800元','3'=>'800-1500元','4'=>'1500-2500元','5'=>'2500-4000元','6'=>'4000元以上'),
//写字楼价格 //写字楼价格
"price_office" => array('1'=>'5000元以下','2'=>'5000-8000元','3'=>'8000-1万元','4'=>'1-1.5万','5'=>'1.5-2万','6'=>'2-5万','7'=>'5万以上'), "price_office" => array('1'=>'5000元以下','2'=>'5000-8000元','3'=>'8000-1万元','4'=>'1-1.5万','5'=>'1.5-2万','6'=>'2-5万','7'=>'5万以上'),
...@@ -668,7 +683,8 @@ $conf_house['wh']= array( ...@@ -668,7 +683,8 @@ $conf_house['wh']= array(
$conf_house['xa']= array( $conf_house['xa']= array(
"district" => array ('高新'=>'高新','城南'=>'城南','长安'=>'长安','城北'=>'城北','城西'=>'城西','城东'=>'城东','城内'=>'城内', '西安周边'=>'西安周边','临潼'=>'临潼','阎良'=>'阎良','蓝田'=>'蓝田'), "district" => array ('高新'=>'高新','城南'=>'城南','长安'=>'长安','城北'=>'城北','城西'=>'城西','城东'=>'城东','城内'=>'城内', '西安周边'=>'西安周边','临潼'=>'临潼','阎良'=>'阎良','蓝田'=>'蓝田'),
"price_sell" => array('1'=>'30万以下','2'=>'30-50万','3'=>'50-80万','4'=>'80-120万','5'=>'120-150万','6'=>'150-200万','7'=>'200万以上'), "price_sell" => array('1'=>'30万以下','2'=>'30-50万','3'=>'50-80万','4'=>'80-120万','5'=>'120-150万','6'=>'150-200万','7'=>'200万以上'),
"buildarea" => array('1'=>'40㎡以下','2'=>'40-60㎡','3'=>'60-80㎡','4'=>'80-100㎡','5'=>'100-120㎡','6'=>'120-150㎡','7'=>'150-200㎡','8'=>'200-400㎡','9'=>'400㎡以上'), "buildarea" => array('1'=>'50㎡以下','2'=>'50-80㎡','3'=>'80-100㎡','4'=>'100-120㎡','5'=>'120-150㎡','6'=>'150-200㎡','7'=>'200-300㎡','8'=>'300㎡以上'),
"rent_buildarea" => array('1'=>'50㎡以下','2'=>'50-100㎡','3'=>'100-200㎡','4'=>'200-300㎡','5'=>'300-500㎡','6'=>'500-1000㎡','7'=>'1000㎡以上'),
"price_rent" => array('1'=>'400元以下','2'=>'400-800元','3'=>'800-1200元','4'=>'1200-1800元','5'=>'1800-2200元','6'=>'2200-4000元','7'=>'4000元以上'), "price_rent" => array('1'=>'400元以下','2'=>'400-800元','3'=>'800-1200元','4'=>'1200-1800元','5'=>'1800-2200元','6'=>'2200-4000元','7'=>'4000元以上'),
//写字楼价格 //写字楼价格
"price_office" => array('1'=>'5000元以下','2'=>'5000-8000元','3'=>'8000-1万元','4'=>'1-1.5万','5'=>'1.5-2万','6'=>'2-5万','7'=>'5万以上'), "price_office" => array('1'=>'5000元以下','2'=>'5000-8000元','3'=>'8000-1万元','4'=>'1-1.5万','5'=>'1.5-2万','6'=>'2-5万','7'=>'5万以上'),
...@@ -730,7 +746,7 @@ $conf_house['tx']= array( ...@@ -730,7 +746,7 @@ $conf_house['tx']= array(
$conf_house['jx']= array( $conf_house['jx']= array(
"district" => array('嘉善'=>'嘉善','平湖'=>'平湖','海盐'=>'海盐','海宁'=>'海宁','桐乡'=>'桐乡','秀洲新区'=>'秀洲新区','南湖新区'=>'南湖新区','中心城区'=>'中心城区','城西区'=>'城西区','城北区'=>'城北区','西南区'=>'西南区','国际商务区'=>'国际商务区','城南区'=>'城南区','湘家荡度假区'=>'湘家荡度假区','其他'=>'其他'), "district" => array('嘉善'=>'嘉善','平湖'=>'平湖','海盐'=>'海盐','海宁'=>'海宁','桐乡'=>'桐乡','秀洲新区'=>'秀洲新区','南湖新区'=>'南湖新区','中心城区'=>'中心城区','城西区'=>'城西区','城北区'=>'城北区','西南区'=>'西南区','国际商务区'=>'国际商务区','城南区'=>'城南区','湘家荡度假区'=>'湘家荡度假区','其他'=>'其他'),
"price_sell" => array('1'=>'40万以下','2'=>'40-60万','3'=>'60-90万','4'=>'90-120万','5'=>'120-150万','6'=>'150-200万','7'=>'200-300万','8'=>'300-500万','9'=>'500万以上'), "price_sell" => array('1'=>'40万以下','2'=>'40-60万','3'=>'60-90万','4'=>'90-120万','5'=>'120-150万','6'=>'150-200万','7'=>'200-300万','8'=>'300-500万','9'=>'500万以上'),
"buildarea" => array('1'=>'40㎡以下','2'=>'40-60㎡','3'=>'60-80㎡','4'=>'80-100㎡','5'=>'100-120㎡','6'=>'120-150㎡','7'=>'150-200㎡','8'=>'200-400㎡','9'=>'400㎡以上'), "buildarea" => array('1'=>'100㎡以下','2'=>'100-120㎡','3'=>'120-150㎡','4'=>'150-200㎡','5'=>'200-300㎡','6'=>'300㎡以上'),
"price_rent" => array('1'=>'500元以下','2'=>'500-800元','3'=>'800-1500元','4'=>'1500-2500元','5'=>'2500-4000元','6'=>'4000元以上'), "price_rent" => array('1'=>'500元以下','2'=>'500-800元','3'=>'800-1500元','4'=>'1500-2500元','5'=>'2500-4000元','6'=>'4000元以上'),
//写字楼价格 //写字楼价格
"price_office" => array('1'=>'5000元以下','2'=>'5000-8000元','3'=>'8000-1万元','4'=>'1-1.5万','5'=>'1.5-2万','6'=>'2-5万','7'=>'5万以上'), "price_office" => array('1'=>'5000元以下','2'=>'5000-8000元','3'=>'8000-1万元','4'=>'1-1.5万','5'=>'1.5-2万','6'=>'2-5万','7'=>'5万以上'),
...@@ -750,7 +766,8 @@ $conf_house['bb']= array( ...@@ -750,7 +766,8 @@ $conf_house['bb']= array(
$conf_house['gy']= array( $conf_house['gy']= array(
"district" => array('云岩'=>'云岩','南明'=>'南明','观山湖'=>'观山湖','小河'=>'小河','乌当'=>'乌当','花溪'=>'花溪','白云'=>'白云','清镇'=>'清镇','开阳'=>'开阳','修文'=>'修文','息烽'=>'息烽','其他'=>'其他'), "district" => array('云岩'=>'云岩','南明'=>'南明','观山湖'=>'观山湖','小河'=>'小河','乌当'=>'乌当','花溪'=>'花溪','白云'=>'白云','清镇'=>'清镇','开阳'=>'开阳','修文'=>'修文','息烽'=>'息烽','其他'=>'其他'),
"price_sell" => array('1'=>'40万以下','2'=>'40-60万','3'=>'60-90万','4'=>'90-120万','5'=>'120-150万','6'=>'150-200万','7'=>'200-300万','8'=>'300-500万','9'=>'500万以上'), "price_sell" => array('1'=>'40万以下','2'=>'40-60万','3'=>'60-90万','4'=>'90-120万','5'=>'120-150万','6'=>'150-200万','7'=>'200-300万','8'=>'300-500万','9'=>'500万以上'),
"buildarea" => array('1'=>'40㎡以下','2'=>'40-60㎡','3'=>'60-80㎡','4'=>'80-100㎡','5'=>'100-120㎡','6'=>'120-150㎡','7'=>'150-200㎡','8'=>'200-400㎡','9'=>'400㎡以上'), "buildarea" => array('1'=>'50㎡以下','2'=>'50-80㎡','3'=>'80-100㎡','4'=>'100-120㎡','5'=>'120-150㎡','6'=>'150-200㎡','7'=>'200-300㎡','8'=>'300㎡以上'),
"rent_buildarea" => array('1'=>'50㎡以下','2'=>'50-100㎡','3'=>'100-200㎡','4'=>'200-300㎡','5'=>'300-500㎡','6'=>'500-1000㎡','7'=>'1000㎡以上'),
"price_rent" => array('1'=>'500元以下','2'=>'500-800元','3'=>'800-1500元','4'=>'1500-2500元','5'=>'2500-4000元','6'=>'4000元以上'), "price_rent" => array('1'=>'500元以下','2'=>'500-800元','3'=>'800-1500元','4'=>'1500-2500元','5'=>'2500-4000元','6'=>'4000元以上'),
//写字楼价格 //写字楼价格
"price_office" => array('1'=>'5000元以下','2'=>'5000-8000元','3'=>'8000-1万元','4'=>'1-1.5万','5'=>'1.5-2万','6'=>'2-5万','7'=>'5万以上'), "price_office" => array('1'=>'5000元以下','2'=>'5000-8000元','3'=>'8000-1万元','4'=>'1-1.5万','5'=>'1.5-2万','6'=>'2-5万','7'=>'5万以上'),
...@@ -760,7 +777,8 @@ $conf_house['gy']= array( ...@@ -760,7 +777,8 @@ $conf_house['gy']= array(
$conf_house['sh']= array( $conf_house['sh']= array(
"district" => array('浦东'=>'浦东','闵行'=>'闵行','徐汇'=>'徐汇','宝山'=>'宝山','普陀'=>'普陀','长宁'=>'长宁','杨浦'=>'杨浦','松江'=>'松江','嘉定'=>'嘉定','虹口'=>'虹口','闸北'=>'闸北','静安'=>'静安','黄浦'=>'黄浦','卢湾'=>'卢湾','青浦'=>'青浦','奉贤'=>'奉贤','金山'=>'金山','崇明'=>'崇明','上海周边'=>'上海周边'), "district" => array('浦东'=>'浦东','闵行'=>'闵行','徐汇'=>'徐汇','宝山'=>'宝山','普陀'=>'普陀','长宁'=>'长宁','杨浦'=>'杨浦','松江'=>'松江','嘉定'=>'嘉定','虹口'=>'虹口','闸北'=>'闸北','静安'=>'静安','黄浦'=>'黄浦','卢湾'=>'卢湾','青浦'=>'青浦','奉贤'=>'奉贤','金山'=>'金山','崇明'=>'崇明','上海周边'=>'上海周边'),
"price_sell" => array('1'=>'40万以下','2'=>'40-60万','3'=>'60-90万','4'=>'90-120万','5'=>'120-150万','6'=>'150-200万','7'=>'200-300万','8'=>'300-500万','9'=>'500万以上'), "price_sell" => array('1'=>'40万以下','2'=>'40-60万','3'=>'60-90万','4'=>'90-120万','5'=>'120-150万','6'=>'150-200万','7'=>'200-300万','8'=>'300-500万','9'=>'500万以上'),
"buildarea" => array('1'=>'40㎡以下','2'=>'40-60㎡','3'=>'60-80㎡','4'=>'80-100㎡','5'=>'100-120㎡','6'=>'120-150㎡','7'=>'150-200㎡','8'=>'200-400㎡','9'=>'400㎡以上'), "buildarea" => array('1'=>'50㎡以下','2'=>'50-80㎡','3'=>'80-100㎡','4'=>'100-120㎡','5'=>'120-150㎡','6'=>'150-200㎡','7'=>'200-300㎡','8'=>'300㎡以上'),
"rent_buildarea" => array('1'=>'50㎡以下','2'=>'50-100㎡','3'=>'100-200㎡','4'=>'200-300㎡','5'=>'300-500㎡','6'=>'500-1000㎡','7'=>'1000㎡以上'),
"price_rent" => array('1'=>'500元以下','2'=>'500-800元','3'=>'800-1500元','4'=>'1500-2500元','5'=>'2500-4000元','6'=>'4000元以上'), "price_rent" => array('1'=>'500元以下','2'=>'500-800元','3'=>'800-1500元','4'=>'1500-2500元','5'=>'2500-4000元','6'=>'4000元以上'),
//写字楼价格 //写字楼价格
"price_office" => array('1'=>'5000元以下','2'=>'5000-8000元','3'=>'8000-1万元','4'=>'1-1.5万','5'=>'1.5-2万','6'=>'2-5万','7'=>'5万以上'), "price_office" => array('1'=>'5000元以下','2'=>'5000-8000元','3'=>'8000-1万元','4'=>'1-1.5万','5'=>'1.5-2万','6'=>'2-5万','7'=>'5万以上'),
...@@ -770,7 +788,8 @@ $conf_house['sh']= array( ...@@ -770,7 +788,8 @@ $conf_house['sh']= array(
$conf_house['bh']= array( $conf_house['bh']= array(
"district" => array('海城区'=>'海城区','银海区'=>'银海区','铁山港'=>'铁山港','合浦县'=>'合浦县','其他区县'=>'其他区县'), "district" => array('海城区'=>'海城区','银海区'=>'银海区','铁山港'=>'铁山港','合浦县'=>'合浦县','其他区县'=>'其他区县'),
"price_sell" => array('1'=>'40万以下','2'=>'40-60万','3'=>'60-90万','4'=>'90-120万','5'=>'120-150万','6'=>'150-200万','7'=>'200-300万','8'=>'300-500万','9'=>'500万以上'), "price_sell" => array('1'=>'40万以下','2'=>'40-60万','3'=>'60-90万','4'=>'90-120万','5'=>'120-150万','6'=>'150-200万','7'=>'200-300万','8'=>'300-500万','9'=>'500万以上'),
"buildarea" => array('1'=>'40㎡以下','2'=>'40-60㎡','3'=>'60-80㎡','4'=>'80-100㎡','5'=>'100-120㎡','6'=>'120-150㎡','7'=>'150-200㎡','8'=>'200-400㎡','9'=>'400㎡以上'), "buildarea" => array('1'=>'50㎡以下','2'=>'50-80㎡','3'=>'80-100㎡','4'=>'100-120㎡','5'=>'120-150㎡','6'=>'150-200㎡','7'=>'200-300㎡','8'=>'300㎡以上'),
"rent_buildarea" => array('1'=>'50㎡以下','2'=>'50-100㎡','3'=>'100-200㎡','4'=>'200-300㎡','5'=>'300-500㎡','6'=>'500-1000㎡','7'=>'1000㎡以上'),
"price_rent" => array('1'=>'500元以下','2'=>'500-800元','3'=>'800-1500元','4'=>'1500-2500元','5'=>'2500-4000元','6'=>'4000元以上'), "price_rent" => array('1'=>'500元以下','2'=>'500-800元','3'=>'800-1500元','4'=>'1500-2500元','5'=>'2500-4000元','6'=>'4000元以上'),
//写字楼价格 //写字楼价格
"price_office" => array('1'=>'5000元以下','2'=>'5000-8000元','3'=>'8000-1万元','4'=>'1-1.5万','5'=>'1.5-2万','6'=>'2-5万','7'=>'5万以上'), "price_office" => array('1'=>'5000元以下','2'=>'5000-8000元','3'=>'8000-1万元','4'=>'1-1.5万','5'=>'1.5-2万','6'=>'2-5万','7'=>'5万以上'),
...@@ -791,7 +810,8 @@ $conf_house['nc']= array( ...@@ -791,7 +810,8 @@ $conf_house['nc']= array(
$conf_house['lyg']= array( $conf_house['lyg']= array(
"district" => array('新浦'=>'新浦','海州'=>'海州','连云'=>'连云','开发'=>'开发','灌南'=>'灌南','灌云'=>'灌云','东海'=>'东海','赣榆'=>'赣榆'), "district" => array('新浦'=>'新浦','海州'=>'海州','连云'=>'连云','开发'=>'开发','灌南'=>'灌南','灌云'=>'灌云','东海'=>'东海','赣榆'=>'赣榆'),
"price_sell" => array('1'=>'40万以下','2'=>'40-60万','3'=>'60-90万','4'=>'90-120万','5'=>'120-150万','6'=>'150-200万','7'=>'200-300万','8'=>'300-500万','9'=>'500万以上'), "price_sell" => array('1'=>'40万以下','2'=>'40-60万','3'=>'60-90万','4'=>'90-120万','5'=>'120-150万','6'=>'150-200万','7'=>'200-300万','8'=>'300-500万','9'=>'500万以上'),
"buildarea" => array('1'=>'40㎡以下','2'=>'40-60㎡','3'=>'60-80㎡','4'=>'80-100㎡','5'=>'100-120㎡','6'=>'120-150㎡','7'=>'150-200㎡','8'=>'200-400㎡','9'=>'400㎡以上'), "buildarea" => array('1'=>'50㎡以下','2'=>'50-80㎡','3'=>'80-100㎡','4'=>'100-120㎡','5'=>'120-150㎡','6'=>'150-200㎡','7'=>'200-300㎡','8'=>'300㎡以上'),
"rent_buildarea" => array('1'=>'50㎡以下','2'=>'50-100㎡','3'=>'100-200㎡','4'=>'200-300㎡','5'=>'300-500㎡','6'=>'500-1000㎡','7'=>'1000㎡以上'),
"price_rent" => array('1'=>'500元以下','2'=>'500-800元','3'=>'800-1500元','4'=>'1500-2500元','5'=>'2500-4000元','6'=>'4000元以上'), "price_rent" => array('1'=>'500元以下','2'=>'500-800元','3'=>'800-1500元','4'=>'1500-2500元','5'=>'2500-4000元','6'=>'4000元以上'),
//写字楼价格 //写字楼价格
"price_office" => array('1'=>'5000元以下','2'=>'5000-8000元','3'=>'8000-1万元','4'=>'1-1.5万','5'=>'1.5-2万','6'=>'2-5万','7'=>'5万以上'), "price_office" => array('1'=>'5000元以下','2'=>'5000-8000元','3'=>'8000-1万元','4'=>'1-1.5万','5'=>'1.5-2万','6'=>'2-5万','7'=>'5万以上'),
...@@ -833,7 +853,8 @@ $conf_house['ty']= array( ...@@ -833,7 +853,8 @@ $conf_house['ty']= array(
$conf_house['aq']= array( $conf_house['aq']= array(
"district" => array('迎江区'=>'迎江区','大观区'=>'大观区','宜秀区'=>'宜秀区','怀宁县'=>'怀宁县','枞阳县'=>'枞阳县','潜山县'=>'潜山县','太湖县'=>'太湖县','宿松县'=>'宿松县','望江县'=>'望江县','岳西县'=>'岳西县','桐城市'=>'桐城市'), "district" => array('迎江区'=>'迎江区','大观区'=>'大观区','宜秀区'=>'宜秀区','怀宁县'=>'怀宁县','枞阳县'=>'枞阳县','潜山县'=>'潜山县','太湖县'=>'太湖县','宿松县'=>'宿松县','望江县'=>'望江县','岳西县'=>'岳西县','桐城市'=>'桐城市'),
"price_sell" => array('1'=>'40万以下','2'=>'40-60万','3'=>'60-90万','4'=>'90-120万','5'=>'120-150万','6'=>'150-200万','7'=>'200-300万','8'=>'300-500万','9'=>'500万以上'), "price_sell" => array('1'=>'40万以下','2'=>'40-60万','3'=>'60-90万','4'=>'90-120万','5'=>'120-150万','6'=>'150-200万','7'=>'200-300万','8'=>'300-500万','9'=>'500万以上'),
"buildarea" => array('1'=>'40㎡以下','2'=>'40-60㎡','3'=>'60-80㎡','4'=>'80-100㎡','5'=>'100-120㎡','6'=>'120-150㎡','7'=>'150-200㎡','8'=>'200-400㎡','9'=>'400㎡以上'), "buildarea" => array('1'=>'50㎡以下','2'=>'50-80㎡','3'=>'80-100㎡','4'=>'100-120㎡','5'=>'120-150㎡','6'=>'150-200㎡','7'=>'200-300㎡','8'=>'300㎡以上'),
"rent_buildarea" => array('1'=>'50㎡以下','2'=>'50-100㎡','3'=>'100-200㎡','4'=>'200-300㎡','5'=>'300-500㎡','6'=>'500-1000㎡','7'=>'1000㎡以上'),
"price_rent" => array('1'=>'500元以下','2'=>'500-800元','3'=>'800-1500元','4'=>'1500-2500元','5'=>'2500-4000元','6'=>'4000元以上'), "price_rent" => array('1'=>'500元以下','2'=>'500-800元','3'=>'800-1500元','4'=>'1500-2500元','5'=>'2500-4000元','6'=>'4000元以上'),
//写字楼价格 //写字楼价格
"price_office" => array('1'=>'5000元以下','2'=>'5000-8000元','3'=>'8000-1万元','4'=>'1-1.5万','5'=>'1.5-2万','6'=>'2-5万','7'=>'5万以上'), "price_office" => array('1'=>'5000元以下','2'=>'5000-8000元','3'=>'8000-1万元','4'=>'1-1.5万','5'=>'1.5-2万','6'=>'2-5万','7'=>'5万以上'),
...@@ -870,7 +891,8 @@ $conf_house['bd']= array( ...@@ -870,7 +891,8 @@ $conf_house['bd']= array(
$conf_house['nn']= array( $conf_house['nn']= array(
"district" => array('兴宁区'=>'兴宁区','青秀区'=>'青秀区','江南区'=>'江南区','西乡塘区'=>'西乡塘区','良庆区'=>'良庆区','邕宁区'=>'邕宁区','武鸣区'=>'武鸣区'), "district" => array('兴宁区'=>'兴宁区','青秀区'=>'青秀区','江南区'=>'江南区','西乡塘区'=>'西乡塘区','良庆区'=>'良庆区','邕宁区'=>'邕宁区','武鸣区'=>'武鸣区'),
"price_sell" => array('1'=>'20万以下','2'=>'20-30万','3'=>'30-40万','4'=>'40-50万','5'=>'50-60万','6'=>'60-70万','7'=>'70-100万','8'=>'100万以上'), "price_sell" => array('1'=>'20万以下','2'=>'20-30万','3'=>'30-40万','4'=>'40-50万','5'=>'50-60万','6'=>'60-70万','7'=>'70-100万','8'=>'100万以上'),
"buildarea" => array('1'=>'40㎡以下','2'=>'40-60㎡','3'=>'60-80㎡','4'=>'80-100㎡','5'=>'100-120㎡','6'=>'120-150㎡','7'=>'150-200㎡','8'=>'200-400㎡','9'=>'400㎡以上'), "buildarea" => array('1'=>'50㎡以下','2'=>'50-80㎡','3'=>'80-100㎡','4'=>'100-120㎡','5'=>'120-150㎡','6'=>'150-200㎡','7'=>'200-300㎡','8'=>'300㎡以上'),
"rent_buildarea" => array('1'=>'50㎡以下','2'=>'50-100㎡','3'=>'100-200㎡','4'=>'200-300㎡','5'=>'300-500㎡','6'=>'500-1000㎡','7'=>'1000㎡以上'),
"price_rent" => array('1'=>'500元以下','2'=>'500-800元','3'=>'800-1500元','4'=>'1500-2500元','5'=>'2500-4000元','6'=>'4000元以上'), "price_rent" => array('1'=>'500元以下','2'=>'500-800元','3'=>'800-1500元','4'=>'1500-2500元','5'=>'2500-4000元','6'=>'4000元以上'),
//写字楼价格 //写字楼价格
"price_office" => array('1'=>'5000元以下','2'=>'5000-8000元','3'=>'8000-1万元','4'=>'1-1.5万','5'=>'1.5-2万','6'=>'2-5万','7'=>'5万以上'), "price_office" => array('1'=>'5000元以下','2'=>'5000-8000元','3'=>'8000-1万元','4'=>'1-1.5万','5'=>'1.5-2万','6'=>'2-5万','7'=>'5万以上'),
...@@ -895,8 +917,11 @@ $conf_house_base = array( ...@@ -895,8 +917,11 @@ $conf_house_base = array(
"officetype" => array ('1'=>'甲级', '2'=>'乙级','3'=>'丙级'), "officetype" => array ('1'=>'甲级', '2'=>'乙级','3'=>'丙级'),
"floortyperent" => array ('1'=>'任意','2'=>'1层','3'=>'2-5层','4'=>'6-12层','5'=>'13层以上'), "floortyperent" => array ('1'=>'任意','2'=>'1层','3'=>'2-5层','4'=>'6-12层','5'=>'13层以上'),
"infofrom" => array ('1'=>'个人', '2'=>'中介门店','5'=>'中介'), "infofrom" => array ('1'=>'个人', '2'=>'中介门店','5'=>'中介'),
"renttype" => array ('整租'=>'整租', '转租'=>'转租', '合租'=>'合租','日租,短租'=>'日租,短租'), // "renttype" => array ('整租'=>'整租', '转租'=>'转租', '合租'=>'合租','日租,短租'=>'日租,短租'),
"renttype_num" => array ('1'=>'整租', '2'=>'转租','3'=>'合租','4'=>'日租,短租'), // "renttype_num" => array ('1'=>'整租', '2'=>'转租','3'=>'合租','4'=>'日租,短租'),
"renttype" => array ('整租'=>'整租', '合租'=>'合租'),// 方式
"renttype_num" => array ('1'=>'整租', '2'=>'合租'),
"fitment" => array ('毛坯'=>'毛坯','简装'=>'简装', '精装'=>'精装','豪华装'=>'豪华装'), "fitment" => array ('毛坯'=>'毛坯','简装'=>'简装', '精装'=>'精装','豪华装'=>'豪华装'),
"fitment_num" => array ('1'=>'毛坯','2'=>'简装', '3'=>'精装','4'=>'豪华装'), "fitment_num" => array ('1'=>'毛坯','2'=>'简装', '3'=>'精装','4'=>'豪华装'),
"priceunit" => array ('1'=>'元/月','2'=>'元/天*平方米','3'=>'元/月*平方米','4'=>'元/天'), "priceunit" => array ('1'=>'元/月','2'=>'元/天*平方米','3'=>'元/月*平方米','4'=>'元/天'),
......
...@@ -52,6 +52,7 @@ $active_record = TRUE; ...@@ -52,6 +52,7 @@ $active_record = TRUE;
//$dsn_esf = "dbdriver://$conf_db_user:$conf_db_password@$conf_db_host/$conf_db_name?char_set=$conf_db_charset&dbcollat=utf8_general_ci&cache_on=false"; //$dsn_esf = "dbdriver://$conf_db_user:$conf_db_password@$conf_db_host/$conf_db_name?char_set=$conf_db_charset&dbcollat=utf8_general_ci&cache_on=false";
$IpHostAllow =explode('.',get_ip()); $IpHostAllow =explode('.',get_ip());
if($IpHostAllow['0']=='127') if($IpHostAllow['0']=='127')
{ {
$conf_db_host ='njesfdbmastervip.house365.com'; $conf_db_host ='njesfdbmastervip.house365.com';
...@@ -156,6 +157,7 @@ if(GB_CITY=='nj') ...@@ -156,6 +157,7 @@ if(GB_CITY=='nj')
$db['dsn_esfhousebak']['swap_pre'] = ''; $db['dsn_esfhousebak']['swap_pre'] = '';
$db['dsn_esfhousebak']['autoinit'] = FALSE; $db['dsn_esfhousebak']['autoinit'] = FALSE;
$db['dsn_esfhousebak']['stricton'] = FALSE; $db['dsn_esfhousebak']['stricton'] = FALSE;
}elseif(GB_CITY=='hf'){ }elseif(GB_CITY=='hf'){
$db['dsn_esfhouse']['hostname'] = $conf_db_host; $db['dsn_esfhouse']['hostname'] = $conf_db_host;
$db['dsn_esfhouse']['username'] = 'root'; $db['dsn_esfhouse']['username'] = 'root';
......
...@@ -135,7 +135,8 @@ class MY_Model extends CI_Model ...@@ -135,7 +135,8 @@ class MY_Model extends CI_Model
public function findAll() { public function findAll() {
$list = array(); $list = array();
$query = $this->db->get($this->form_name); $query = $this->db->get($this->form_name);
$result = $query->result_array(); // $result = $query->result_array();
$result = $query->num_rows > 0 ? $query->result_array() : array();
$sqls = $this->db->last_query(); $sqls = $this->db->last_query();
//echo "<!--$sqls-->"; //echo "<!--$sqls-->";
//echo $this->db->last_query();exit; //echo $this->db->last_query();exit;
...@@ -248,11 +249,11 @@ class MY_Model extends CI_Model ...@@ -248,11 +249,11 @@ class MY_Model extends CI_Model
{ {
if (strlen($data['limit']) && is_numeric($data['limit'])) if (strlen($data['limit']) && is_numeric($data['limit']))
{ {
($data['limit'] > 0) ? $this->db->limit($data['offset'], $data['limit']) : $this->db->limit($data['offset']); ($data['limit'] > 0) ? $this->db->offset($data['offset'])->limit($data['limit']) : $this->db->offset($data['offset'])->limit(20);
} }
else else
{ {
$this->db->limit($data['offset']); $this->db->offset($data['offset'])->limit(20);
} }
} }
else else
......
...@@ -2,43 +2,43 @@ ...@@ -2,43 +2,43 @@
/** /**
* sendsms($mobile,$msg) * sendsms($mobile,$msg)
* *
* 发送短信 * 发送短信
* @param none * @param none
* @global none * @global none
* @return void * @return void
* @update 2011-10-25 * @update 2011-10-25
*/ */
function sendsms($mobile,$msg,$type='ad',$yzm="") function sendsms($mobile,$msg,$type='ad',$yzm="")
{ {
get_api(API_ESF_SENDSMS."?conf_cityflag=nj&mobile=".$mobile."&msg=".urlencode($msg)."&type=".$type."&ymz=".$yzm); get_api(API_ESF_SENDSMS."?conf_cityflag=nj&mobile=".$mobile."&msg=".urlencode($msg)."&type=".$type."&ymz=".$yzm);
} }
/** /**
* get_api($url, $nocache = 0) * get_api($url, $nocache = 0)
* *
* 接口函数 Fisher 2013-1-12 * 接口函数 Fisher 2013-1-12
*/ */
if(!function_exists('get_api')) if(!function_exists('get_api'))
{ {
function get_api($url,$nocache = 0) function get_api($url,$nocache = 0)
{ {
return curl_get_contents($url,$nocache); return curl_get_contents($url,$nocache);
} }
} }
function curl_get_contents($str,$t_url="") function curl_get_contents($str,$t_url="")
{ {
$ch = curl_init(); $ch = curl_init();
$t_url = $t_url ? $t_url : "http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; $t_url = $t_url ? $t_url : "http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
curl_setopt($ch, CURLOPT_URL, $str); curl_setopt($ch, CURLOPT_URL, $str);
curl_setopt($ch, CURLOPT_REFERER, $t_url); curl_setopt($ch, CURLOPT_REFERER, $t_url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch,CURLOPT_RETURNTRANSFER, 1);
$str = curl_exec($ch); $str = curl_exec($ch);
curl_close($ch); curl_close($ch);
return $str; return $str;
} }
function curl_get_contents_new($str,$t_url="", $cookie = '') function curl_get_contents_new($str,$t_url="", $cookie = '')
{ {
...@@ -61,43 +61,43 @@ function curl_get_contents_new($str,$t_url="", $cookie = '') ...@@ -61,43 +61,43 @@ function curl_get_contents_new($str,$t_url="", $cookie = '')
/** /**
* random($length) * random($length)
* *
* 产生随机数函数 * 产生随机数函数
* @param none * @param none
* @global none * @global none
* @return void * @return void
* @update 2011-10-25 * @update 2011-10-25
*/ */
function random($length) { function random($length) {
$hash = ''; $hash = '';
$chars = '123456789'; $chars = '123456789';
$max = strlen($chars) - 1; $max = strlen($chars) - 1;
for($i = 0; $i < $length; $i++) { for($i = 0; $i < $length; $i++) {
$hash .= $chars[mt_rand(0, $max)]; $hash .= $chars[mt_rand(0, $max)];
} }
return $hash; return $hash;
} }
if(!function_exists('jumpto')) if(!function_exists('jumpto'))
{ {
function jumpto($url, $sec = 1000) function jumpto($url, $sec = 1000)
{ {
echo "<script>setTimeout(function(){window.location.href='".$url."';}, ".$sec.");</script>"; echo "<script>setTimeout(function(){window.location.href='".$url."';}, ".$sec.");</script>";
exit; exit;
} }
} }
if(!function_exists('jumptotk')) if(!function_exists('jumptotk'))
{ {
function jumptotk($url, $message = "执行完毕!", $sec = 3000, $template = "tips") function jumptotk($url, $message = "执行完毕!", $sec = 3000, $template = "tips")
{ {
if($template == 'tips') if($template == 'tips')
{ {
echo '<div class="pop" style="width:390px;height:160px; position:absolute;left:50%;top:50%;margin-left:-200px;margin-top:-120px;-moz-box-shadow: 0 0 34px #cacaca;-webkit-box-shadow: 0 0 34px #cacaca;box-shadow: 0 0 34px #cacaca;border:1px solid #ccc;"> echo '<div class="pop" style="width:390px;height:160px; position:absolute;left:50%;top:50%;margin-left:-200px;margin-top:-120px;-moz-box-shadow: 0 0 34px #cacaca;-webkit-box-shadow: 0 0 34px #cacaca;box-shadow: 0 0 34px #cacaca;border:1px solid #ccc;">
<div class="hd" style="height:40px;background:#FF8400"> <div class="hd" style="height:40px;background:#FF8400">
<h2 style="font-size:14px;color:#fff;font-weight:800; position:absolute;left:10px;top:10px">提示</h2> <h2 style="font-size:14px;color:#fff;font-weight:800; position:absolute;left:10px;top:10px">提示</h2>
<a href="javascript:void(0)" class="close-pop" style="display:block;width:30px;height:30px;background:url('.USER_CENTER.'images/pop-ico.gif) 0 -80px no-repeat; position:absolute;right:10px;top:6px; text-indent:-999px; overflow:hidden" onclick="location.href=\''.$url.'\'">关闭</a> <a href="javascript:void(0)" class="close-pop" style="display:block;width:30px;height:30px;background:url('.USER_CENTER.'images/pop-ico.gif) 0 -80px no-repeat; position:absolute;right:10px;top:6px; text-indent:-999px; overflow:hidden" onclick="location.href=\''.$url.'\'">关闭</a>
</div> </div>
<div class="bd" style="background:#fff;height:120px"> <div class="bd" style="background:#fff;height:120px">
<div style="width:70px;height:80px;background:url('.USER_CENTER.'images/pop-ico.gif) no-repeat; position:absolute;left:70px;top:60px"></div> <div style="width:70px;height:80px;background:url('.USER_CENTER.'images/pop-ico.gif) no-repeat; position:absolute;left:70px;top:60px"></div>
...@@ -105,25 +105,25 @@ if(!function_exists('jumptotk')) ...@@ -105,25 +105,25 @@ if(!function_exists('jumptotk'))
</div> </div>
</div>'; </div>';
}elseif($template == 'tipswaring'){ }elseif($template == 'tipswaring'){
echo '<div class="pop" style="width:390px;height:160px;border:1px solid #ccc; position:absolute;left:50%;top:50%;margin-left:-200px;margin-top:-120px;-moz-box-shadow: 0 0 34px #cacaca;-webkit-box-shadow: 0 0 34px #cacaca;box-shadow: 0 0 34px #cacaca;"> echo '<div class="pop" style="width:390px;height:160px;border:1px solid #ccc; position:absolute;left:50%;top:50%;margin-left:-200px;margin-top:-120px;-moz-box-shadow: 0 0 34px #cacaca;-webkit-box-shadow: 0 0 34px #cacaca;box-shadow: 0 0 34px #cacaca;">
<div class="hd" style="height:40px;background:#FF8400"> <div class="hd" style="height:40px;background:#FF8400">
<h2 style="font-size:14px;color:#fff;font-weight:800; position:absolute;left:10px;top:10px">提示</h2> <h2 style="font-size:14px;color:#fff;font-weight:800; position:absolute;left:10px;top:10px">提示</h2>
<a href="javascript:void(0)" class="close-pop" style="display:block;width:30px;height:30px;background:url('.USER_CENTER.'images/pop-ico.gif) 0 -80px no-repeat; position:absolute;right:10px;top:6px; text-indent:-999px; overflow:hidden" onclick="location.href=\''.$url.'\'">关闭</a> <a href="javascript:void(0)" class="close-pop" style="display:block;width:30px;height:30px;background:url('.USER_CENTER.'images/pop-ico.gif) 0 -80px no-repeat; position:absolute;right:10px;top:6px; text-indent:-999px; overflow:hidden" onclick="location.href=\''.$url.'\'">关闭</a>
</div> </div>
<div style="width:70px;height:80px;background:url('.USER_CENTER.'images/pop-ico.gif) no-repeat -2px -113px; position:absolute;left:70px;top:60px"></div> <div style="width:70px;height:80px;background:url('.USER_CENTER.'images/pop-ico.gif) no-repeat -2px -113px; position:absolute;left:70px;top:60px"></div>
<p style="position:absolute;left:160px;top:85px;font-size:14px">'.$message.'</p> <p style="position:absolute;left:160px;top:85px;font-size:14px">'.$message.'</p>
</div> </div>
</div>'; </div>';
} }
echo "<script>setTimeout(function(){window.location.href='".$url."';}, ".$sec.");</script>"; echo "<script>setTimeout(function(){window.location.href='".$url."';}, ".$sec.");</script>";
exit; exit;
} }
} }
function tel_yc($tel) function tel_yc($tel)
{ {
//隐藏手机号部分数字 //隐藏手机号部分数字
$pattern = "/(1\d{1,2})\d\d(\d{0,3})/"; $pattern = "/(1\d{1,2})\d\d(\d{0,3})/";
$replacement = "\$1****\$3"; $replacement = "\$1****\$3";
...@@ -131,33 +131,33 @@ function tel_yc($tel) ...@@ -131,33 +131,33 @@ function tel_yc($tel)
} }
/*设置登录cookie*/ /*设置登录cookie*/
function vbsetcookie($name,$value="",$permanent=1) { function vbsetcookie($name,$value="",$permanent=1) {
$cookiedomain=".house365.com"; $cookiedomain=".house365.com";
$cookiepath="/"; $cookiepath="/";
if ($permanent) { if ($permanent) {
$expire=time() + 60*60*24*365; $expire=time() + 60*60*24*365;
} else { } else {
$expire = 0; $expire = 0;
} }
setcookie($name, $value, $expire, $cookiepath, $cookiedomain, 0); setcookie($name, $value, $expire, $cookiepath, $cookiedomain, 0);
} }
/*设置cookie,session*/ /*设置cookie,session*/
function setcoandsess($name,$value="",$permanent=1) { function setcoandsess($name,$value="",$permanent=1) {
$cookiedomain=".house365.com"; $cookiedomain=".house365.com";
$cookiepath="/"; $cookiepath="/";
if ($permanent) { if ($permanent) {
$expire=time() + 60*60*24*365; $expire=time() + 60*60*24*365;
} else { } else {
$expire = 0; $expire = 0;
} }
setcookie($name, $value, $expire, $cookiepath, $cookiedomain, 0); setcookie($name, $value, $expire, $cookiepath, $cookiedomain, 0);
$_SESSION[$name] = $value; $_SESSION[$name] = $value;
...@@ -179,11 +179,11 @@ function StrCode($string,$action='ENCODE'){ ...@@ -179,11 +179,11 @@ function StrCode($string,$action='ENCODE'){
/** /**
* GetIP - 获取客户端IP地址 * GetIP - 获取客户端IP地址
* *
* @access public * @access public
* @param none * @param none
* @return string IP地址 * @return string IP地址
*/ */
if ( ! function_exists('get_ip')) if ( ! function_exists('get_ip'))
{ {
...@@ -205,204 +205,234 @@ if ( ! function_exists('get_ip')) ...@@ -205,204 +205,234 @@ if ( ! function_exists('get_ip'))
//南京站根据表名和房源ID获取房源图片存储的表名称 //南京站根据表名和房源ID获取房源图片存储的表名称
if ( ! function_exists('get_upload_tblname')) if ( ! function_exists('get_upload_tblname'))
{ {
function get_upload_tblname($tbl,$id){ function get_upload_tblname($tbl,$id){
if(GB_CITY !='nj') return 'upload';
if($tbl == 'sell' && $id < 23972101) return 'upload0'; if(GB_CITY == 'wh'){
if($tbl == 'sell' && $id < 10310000) return 'upload';
if($tbl == 'rent' && $id < 1577000) return 'upload';
if($tbl == 'rent' && $id < 11907211) return 'upload0'; if($tbl == 'sell' && ($id >= 10310000 && $id < 15591000)) return 'upload1';
if($tbl == 'sell' && ($id >= 23972101 && $id < 27029364)) return 'upload1'; if($tbl == 'rent' && ($id >= 1577000 && $id < 1809000)) return 'upload1';
return 'upload2';
}
if($tbl == 'rent' && ($id >= 11907211 && $id < 13224200)) return 'upload1'; if(GB_CITY !='nj') return 'upload';
if($tbl == 'sell' && ($id >= 27029364 && $id < 31695721)) return 'upload2'; if($tbl == 'sell' && $id < 23972101) return 'upload0';
if($tbl == 'rent' && ($id >= 13224200 && $id < 14495163)) return 'upload2'; if($tbl == 'rent' && $id < 11907211) return 'upload0';
if($tbl == 'sell' && ($id >= 31695721 && $id < 34963370)) return 'upload3'; if($tbl == 'sell' && ($id >= 23972101 && $id < 27029364)) return 'upload1';
if($tbl == 'rent' && ($id >= 14495163 && $id < 15172611)) return 'upload3'; if($tbl == 'rent' && ($id >= 11907211 && $id < 13224200)) return 'upload1';
if($tbl == 'sell' && ($id >= 34963370 && $id < 38640564)) return 'upload4'; if($tbl == 'sell' && ($id >= 27029364 && $id < 31695721)) return 'upload2';
if($tbl == 'rent' && ($id >= 15172611 && $id < 15871631)) return 'upload4'; if($tbl == 'rent' && ($id >= 13224200 && $id < 14495163)) return 'upload2';
if($tbl == 'sell' && ($id >= 38640564 && $id < 42138930)) return 'upload5'; if($tbl == 'sell' && ($id >= 31695721 && $id < 34963370)) return 'upload3';
if($tbl == 'rent' && ($id >= 15871631 && $id < 16675751)) return 'upload5'; if($tbl == 'rent' && ($id >= 14495163 && $id < 15172611)) return 'upload3';
if($tbl == 'sell' && ($id >= 42138930 && $id < 45947999)) return 'upload'; if($tbl == 'sell' && ($id >= 34963370 && $id < 38640564)) return 'upload4';
if($tbl == 'rent' && ($id >= 16675751 && $id < 43871899)) return 'upload'; if($tbl == 'rent' && ($id >= 15172611 && $id < 15871631)) return 'upload4';
if($tbl == 'sell' && ($id >= 45947999 && $id < 49830000)) return 'upload6'; if($tbl == 'sell' && ($id >= 38640564 && $id < 42138930)) return 'upload5';
//49825505
if($tbl == 'rent' && ($id >= 43871899 && $id < 45040000)) return 'upload6';
//45038726
if($tbl == 'sell' && ($id >= 49830000 && $id < 54705651)) return 'upload7'; if($tbl == 'rent' && ($id >= 15871631 && $id < 16675751)) return 'upload5';
//54703651
if($tbl == 'rent' && ($id >= 45040000 && $id < 45788862)) return 'upload7'; if($tbl == 'sell' && ($id >= 42138930 && $id < 45947999)) return 'upload';
//45787862
if($tbl == 'sell' && ($id >= 54705651 && $id < 58020733)) return 'upload8'; if($tbl == 'rent' && ($id >= 16675751 && $id < 43871899)) return 'upload';
//58018737
if($tbl == 'rent' && ($id >= 45788862 && $id < 46230598)) return 'upload8'; if($tbl == 'sell' && ($id >= 45947999 && $id < 49830000)) return 'upload6';
//46229598 //49825505
if($tbl == 'sell' && ($id >= 58020733 && $id < 61223139)) return 'upload9'; if($tbl == 'rent' && ($id >= 43871899 && $id < 45040000)) return 'upload6';
//61221139 //45038726
if($tbl == 'rent' && ($id >= 46230598 && $id < 46633747)) return 'upload9';
//46633347 if($tbl == 'sell' && ($id >= 49830000 && $id < 54705651)) return 'upload7';
if($tbl == 'sell' && ($id >= 61223139 && $id < 63983200)) return 'upload10'; //54703651
//63981991 if($tbl == 'rent' && ($id >= 45040000 && $id < 45788862)) return 'upload7';
if($tbl == 'rent' && ($id >= 46633747 && $id < 46923000)) return 'upload10'; //45787862
//46922654 if($tbl == 'sell' && ($id >= 54705651 && $id < 58020733)) return 'upload8';
if($tbl == 'sell' && ($id >= 63983200 && $id < 66893902)) return 'upload11'; //58018737
//66892902 if($tbl == 'rent' && ($id >= 45788862 && $id < 46230598)) return 'upload8';
if($tbl == 'rent' && ($id >= 46923000 && $id < 47264784)) return 'upload11'; //46229598
//47264284 if($tbl == 'sell' && ($id >= 58020733 && $id < 61223139)) return 'upload9';
if($tbl == 'sell' && ($id >= 66893902 && $id < 71182067)) return 'upload12'; //61221139
//71181067 if($tbl == 'rent' && ($id >= 46230598 && $id < 46633747)) return 'upload9';
if($tbl == 'rent' && ($id >= 47264784 && $id < 47951200)) return 'upload12'; //46633347
//47950659 if($tbl == 'sell' && ($id >= 61223139 && $id < 63983200)) return 'upload10';
//63981991
if($tbl == 'rent' && ($id >= 46633747 && $id < 46923000)) return 'upload10';
//46922654
if($tbl == 'sell' && ($id >= 63983200 && $id < 66893902)) return 'upload11';
//66892902
if($tbl == 'rent' && ($id >= 46923000 && $id < 47264784)) return 'upload11';
//47264284
if($tbl == 'sell' && ($id >= 66893902 && $id < 71182067)) return 'upload12';
//71181067
if($tbl == 'rent' && ($id >= 47264784 && $id < 47951200)) return 'upload12';
//47950659
if($tbl == 'sell' && ($id >= 71182067 && $id < 76015831)) return 'upload13'; if($tbl == 'sell' && ($id >= 71182067 && $id < 76015831)) return 'upload13';
//76014531 //76014531
if($tbl == 'rent' && ($id >= 47951200 && $id < 48556731)) return 'upload13'; //48556231 if($tbl == 'rent' && ($id >= 47951200 && $id < 48556731)) return 'upload13'; //48556231
if($tbl == 'sell' && ($id >= 76015831 && $id < 81507192)) return 'upload14'; if($tbl == 'sell' && ($id >= 76015831 && $id < 81507192)) return 'upload14';
//81506192 //81506192
if($tbl == 'rent' && ($id >= 48556731 && $id < 49140972)) return 'upload14'; //49140466 if($tbl == 'rent' && ($id >= 48556731 && $id < 49140972)) return 'upload14'; //49140466
if($tbl == 'sell' && ($id >= 81507192 && $id < 88723014)) return 'upload15'; if($tbl == 'sell' && ($id >= 81507192 && $id < 88723014)) return 'upload15';
//88722131 //88722131
if($tbl == 'rent' && ($id >= 49140972 && $id < 49884209)) return 'upload15'; if($tbl == 'rent' && ($id >= 49140972 && $id < 49884209)) return 'upload15';
//49883609 //49883609
if($tbl == 'sell' && ($id >= 88723014 && $id < 95316101)) return 'upload16'; if($tbl == 'sell' && ($id >= 88723014 && $id < 95316101)) return 'upload16';
//95314101 //95314101
if($tbl == 'rent' && ($id >= 49884209 && $id < 50532293)) return 'upload16'; if($tbl == 'rent' && ($id >= 49884209 && $id < 50532293)) return 'upload16';
//50531293 //50531293
if($tbl == 'sell' && ($id >= 95316101 && $id < 103859999)) return 'upload17'; if($tbl == 'sell' && ($id >= 95316101 && $id < 103859999)) return 'upload17';
//103819999 //103819999
if($tbl == 'rent' && ($id >= 50532293 && $id < 51527468)) return 'upload17'; if($tbl == 'rent' && ($id >= 50532293 && $id < 51527468)) return 'upload17';
//51527468 //51527468
if($tbl == 'sell' && ($id >= 103859999 && $id < 108815839)) return 'upload18'; if($tbl == 'sell' && ($id >= 103859999 && $id < 108815839)) return 'upload18';
//108806111 //108806111
if($tbl == 'rent' && ($id >= 51527468 && $id < 52249156)) return 'upload18'; if($tbl == 'rent' && ($id >= 51527468 && $id < 52249156)) return 'upload18';
//52239180 //52239180
if($tbl == 'sell' && ($id >= 108815839 && $id < 114379999)) return 'upload19'; if($tbl == 'sell' && ($id >= 108815839 && $id < 114379999)) return 'upload19';
if($tbl == 'rent' && ($id >= 52249156 && $id < 53130499)) return 'upload19'; if($tbl == 'rent' && ($id >= 52249156 && $id < 53130499)) return 'upload19';
if($tbl == 'sell' && ($id >= 114379999 && $id < 119229999)) return 'upload20'; if($tbl == 'sell' && ($id >= 114379999 && $id < 119229999)) return 'upload20';
if($tbl == 'rent' && ($id >= 53130499 && $id < 53780499)) return 'upload20'; if($tbl == 'rent' && ($id >= 53130499 && $id < 53780499)) return 'upload20';
if($tbl == 'sell' && ($id >= 119229999 && $id < 123619999)) return 'upload21'; if($tbl == 'sell' && ($id >= 119229999 && $id < 123619999)) return 'upload21';
if($tbl == 'rent' && ($id >= 53780499 && $id < 54659999)) return 'upload21'; if($tbl == 'rent' && ($id >= 53780499 && $id < 54659999)) return 'upload21';
if($tbl == 'sell' && ($id >= 123619999 && $id < 128434999)) return 'upload22'; if($tbl == 'sell' && ($id >= 123619999 && $id < 128434999)) return 'upload22';
if($tbl == 'rent' && ($id >= 54659999 && $id < 55793999)) return 'upload22'; if($tbl == 'rent' && ($id >= 54659999 && $id < 55793999)) return 'upload22';
if($tbl == 'sell' && ($id >= 128434999 && $id < 132662039)) return 'upload23'; if($tbl == 'sell' && ($id >= 128434999 && $id < 132662039)) return 'upload23';
if($tbl == 'rent' && ($id >= 55793999 && $id < 56609929)) return 'upload23'; if($tbl == 'rent' && ($id >= 55793999 && $id < 56609929)) return 'upload23';
if($tbl == 'sell' && ($id >= 132662039 && $id < 136312505)) return 'upload24'; if($tbl == 'sell' && ($id >= 132662039 && $id < 136312505)) return 'upload24';
if($tbl == 'rent' && ($id >= 56609929 && $id < 57307409)) return 'upload24'; if($tbl == 'rent' && ($id >= 56609929 && $id < 57307409)) return 'upload24';
if($tbl == 'sell' && ($id >= 136312505 && $id < 140145507)) return 'upload25'; if($tbl == 'sell' && ($id >= 136312505 && $id < 140145507)) return 'upload25';
if($tbl == 'rent' && ($id >= 57307409 && $id < 58017786)) return 'upload25'; if($tbl == 'rent' && ($id >= 57307409 && $id < 58017786)) return 'upload25';
if($tbl == 'sell' && ($id >= 140145507 && $id < 147125418)) return 'upload26'; if($tbl == 'sell' && ($id >= 140145507 && $id < 147125418)) return 'upload26';
if($tbl == 'rent' && ($id >= 58017786 && $id < 59209979)) return 'upload26'; if($tbl == 'rent' && ($id >= 58017786 && $id < 59209979)) return 'upload26';
if($tbl == 'sell' && ($id >= 147125418 && $id < 154138704)) return 'upload27'; if($tbl == 'sell' && ($id >= 147125418 && $id < 154138704)) return 'upload27';
if($tbl == 'rent' && ($id >= 59209979 && $id < 60562010)) return 'upload27'; if($tbl == 'rent' && ($id >= 59209979 && $id < 60562010)) return 'upload27';
if($tbl == 'sell' && ($id >= 154138704 && $id < 166754880)) return 'upload28'; if($tbl == 'sell' && ($id >= 154138704 && $id < 166754880)) return 'upload28';
if($tbl == 'rent' && ($id >= 60562010 && $id < 63483875)) return 'upload28'; if($tbl == 'rent' && ($id >= 60562010 && $id < 63483875)) return 'upload28';
if($tbl == 'sell' && ($id >= 166754880 && $id < 264744742)) return 'upload29'; if($tbl == 'sell' && ($id >= 166754880 && $id < 264744742)) return 'upload29';
if($tbl == 'rent' && ($id >= 63483875 && $id < 84955643)) return 'upload29'; if($tbl == 'rent' && ($id >= 63483875 && $id < 84955643)) return 'upload29';
return 'upload30'; if($tbl == 'sell' && ($id >= 264744742 && $id < 271465540)) return 'upload30';
}
if($tbl == 'rent' && ($id >= 84955643 && $id < 86646071)) return 'upload30';
if($tbl == 'sell' && ($id >= 271465540 && $id < 282952050)) return 'upload31';
if($tbl == 'rent' && ($id >= 86646071 && $id < 89874731)) return 'upload31';
if($tbl == 'sell' && ($id >= 282952050 && $id < 288033939)) return 'upload32';
if($tbl == 'rent' && ($id >= 89874731 && $id < 91709557)) return 'upload32';
if($tbl == 'sell' && ($id >= 288033939 && $id < 289572177)) return 'upload33';
if($tbl == 'rent' && ($id >= 91709557 && $id < 92295581)) return 'upload33';
if($tbl == 'sell' && ($id >= 289572177 && $id < 332826911)) return 'upload34';
if($tbl == 'rent' && ($id >= 92295581 && $id < 105588509)) return 'upload34';
return 'upload35';
}
} }
/** /**
* 获取二手房的房源地址 * 获取二手房的房源地址
* @param array $row 房源信息,必须含有id * @param array $row 房源信息,必须含有id
* @return stirng * @return stirng
*/ */
if(!function_exists('get_sellinfo_url')) if(!function_exists('get_sellinfo_url'))
{ {
function get_sellinfo_url($row) function get_sellinfo_url($row)
{ {
if(is_array($row)) { if(is_array($row)) {
if(!empty($row['ID']))$row['id']=$row['ID']; if(!empty($row['ID']))$row['id']=$row['ID'];
$ss = GB_SELL_URL."/s_".$row['id'].".html"; $ss = GB_SELL_URL."/s_".$row['id'].".html";
}else{ }else{
$ss = GB_SELL_URL."/s_".$row.".html"; $ss = GB_SELL_URL."/s_".$row.".html";
} }
return $ss; return $ss;
} }
} }
/** /**
* 获取求购地址 * 获取求购地址
* @param array $row 房源信息,必须含有id * @param array $row 房源信息,必须含有id
* @return stirng * @return stirng
*/ */
if(!function_exists('get_buyinfo_url')) if(!function_exists('get_buyinfo_url'))
{ {
function get_buyinfo_url($row) function get_buyinfo_url($row)
{ {
if(is_array($row)) { if(is_array($row)) {
if(!empty($row['ID']))$row['id']=$row['ID']; if(!empty($row['ID']))$row['id']=$row['ID'];
$ss = $GB_SELL_URL."/b_".$row['id'].".html"; $ss = $GB_SELL_URL."/b_".$row['id'].".html";
} else { } else {
$ss = $GB_SELL_URL."/b_".$row.".html"; $ss = $GB_SELL_URL."/b_".$row.".html";
} }
return $ss; return $ss;
} }
} }
/** /**
* 获取租房的房源地址 * 获取租房的房源地址
* @param array $row 房源信息,必须含有id * @param array $row 房源信息,必须含有id
* @return stirng * @return stirng
*/ */
if(!function_exists('get_rentinfo_url')) if(!function_exists('get_rentinfo_url'))
{ {
function get_rentinfo_url($row,$pre = 'r') //房源地址 function get_rentinfo_url($row,$pre = 'r') //房源地址
{ {
if(is_array($row)) { if(is_array($row)) {
if(!empty($row['ID'])) $id = $row['ID']; if(!empty($row['ID'])) $id = $row['ID'];
...@@ -418,78 +448,78 @@ if(!function_exists('get_rentinfo_url')) ...@@ -418,78 +448,78 @@ if(!function_exists('get_rentinfo_url'))
} }
/** /**
* 获取问答地址 * 获取问答地址
* @param array $qid * @param array $qid
* @return stirng * @return stirng
*/ */
if(!function_exists('get_questioninfo_url')) if(!function_exists('get_questioninfo_url'))
{ {
function get_questioninfo_url($qid) //房源地址 function get_questioninfo_url($qid) //房源地址
{ {
$ss = GB_SELL_URL."/ask_".$qid.".html"; $ss = GB_SELL_URL."/ask_".$qid.".html";
return $ss; return $ss;
} }
} }
/** /**
* 获取小区地址 * 获取小区地址
* @param array $id * @param array $id
* @return stirng * @return stirng
*/ */
function get_blockinfo_url($id) function get_blockinfo_url($id)
{ {
$ss = GB_SELL_URL."/community_id".$id."/"; $ss = GB_SELL_URL."/community_id".$id."/";
return $ss; return $ss;
} }
/** /**
*获取学校地址 *获取学校地址
*@param int $id *@param int $id
*@return string *@return string
*/ */
function get_school_url($id){ function get_school_url($id){
$url = GB_SELL_URL."/school_id".$id."/"; $url = GB_SELL_URL."/school_id".$id."/";
return $url; return $url;
} }
/** /**
*获取学校小区地址 *获取学校小区地址
*@param int $id *@param int $id
*@return string *@return string
*/ */
function get_schoolblock_url($id){ function get_schoolblock_url($id){
$url = GB_SELL_URL."/school_id".$id."/community.html"; $url = GB_SELL_URL."/school_id".$id."/community.html";
return $url; return $url;
} }
/** /**
*获取学校二手房地址 *获取学校二手房地址
*@param int $id *@param int $id
*@return string *@return string
*/ */
function get_schoolsell_url($id){ function get_schoolsell_url($id){
$url = GB_SELL_URL."/school_id".$id."/sell.html"; $url = GB_SELL_URL."/school_id".$id."/sell.html";
return $url; return $url;
} }
/** /**
*获取学校租房地址 *获取学校租房地址
*@param int $id *@param int $id
*@return string *@return string
*/ */
function get_schoolrent_url($id){ function get_schoolrent_url($id){
$url = GB_SELL_URL."/school_id".$id."/rent.html"; $url = GB_SELL_URL."/school_id".$id."/rent.html";
return $url; return $url;
} }
/** /**
* 判断值是否为数组 * 判断值是否为数组
* @param array $arrValue * @param array $arrValue
* @return bool true or false * @return bool true or false
* @author sun * @author sun
...@@ -499,11 +529,11 @@ function isFullArray($arrValue) { ...@@ -499,11 +529,11 @@ function isFullArray($arrValue) {
} }
/** /**
* time_tran 距离现在时间多久 * time_tran 距离现在时间多久
* *
* @param string $the_time 时间参数 * @param string $the_time 时间参数
* @return string 描述字符串 * @return string 描述字符串
*/ */
function time_tran ($the_time) { function time_tran ($the_time) {
$now_time = time(); $now_time = time();
...@@ -513,22 +543,22 @@ function time_tran ($the_time) { ...@@ -513,22 +543,22 @@ function time_tran ($the_time) {
$str = $the_time; $str = $the_time;
}else{ }else{
if($dur < 60){ if($dur < 60){
$str = $dur.'秒前'; $str = $dur.'秒前';
}else if($dur < 3600){ }else if($dur < 3600){
$str = floor($dur/60).'分钟前'; $str = floor($dur/60).'分钟前';
}else if($dur < 86400){ }else if($dur < 86400){
$str = floor($dur/3600).'小时前'; $str = floor($dur/3600).'小时前';
}else if($dur < 259200){ }else if($dur < 259200){
$str = floor($dur/86400).'天前'; $str = floor($dur/86400).'天前';
}else if($dur > 259200){ }else if($dur > 259200){
$str = date('Y-m-d H:i',$the_time); $str = date('Y-m-d H:i',$the_time);
} }
} }
return $str; return $str;
} }
//加密,解密函数 FISHER 2014-3-5 //加密,解密函数 FISHER 2014-3-5
function passport_encrypt($txt, $key='fisher.house365.com') { function passport_encrypt($txt, $key='fisher.house365.com') {
srand((double)microtime() * 1000000); srand((double)microtime() * 1000000);
$encrypt_key = md5(rand(0, 32000)); $encrypt_key = md5(rand(0, 32000));
...@@ -563,36 +593,36 @@ function passport_key($txt, $encrypt_key) { ...@@ -563,36 +593,36 @@ function passport_key($txt, $encrypt_key) {
function check_input($value) function check_input($value)
{ {
// 去除斜杠 // 去除斜杠
if (get_magic_quotes_gpc()) if (get_magic_quotes_gpc())
{ {
$value = stripslashes($value); $value = stripslashes($value);
} }
// 如果不是数字则加引号 // 如果不是数字则加引号
if (!is_numeric($value)) if (!is_numeric($value))
{ {
$value = "'" . mysql_real_escape_string($value) . "'"; $value = "'" . mysql_real_escape_string($value) . "'";
} }
return $value; return $value;
} }
/** /**
* jsonNew 对数据进行gbk转utf8后json编码 json($data) * jsonNew 对数据进行gbk转utf8后json编码 json($data)
* @param mixed $data 需要编码的数据 * @param mixed $data 需要编码的数据
* @return mixed $data_json 编码后的数据 * @return mixed $data_json 编码后的数据
* @ 2012-10-16 xz * @ 2012-10-16 xz
**/ **/
function jsonNew($data,$inChar="GBK",$outChar="UTF-8") { function jsonNew($data,$inChar="GBK",$outChar="UTF-8") {
if(!$data) return $data; if(!$data) return $data;
$data = strIconv($data,$inChar,$outChar); $data = strIconv($data,$inChar,$outChar);
return json_encode($data); return json_encode($data);
} }
/** /**
* 替换数组编码(支持字符串和多维数组) * 替换数组编码(支持字符串和多维数组)
* @param mixed $strInput * @param mixed $strInput
* @param string $inChar * @param string $inChar
* @param string $outChar * @param string $outChar
...@@ -600,42 +630,42 @@ function jsonNew($data,$inChar="GBK",$outChar="UTF-8") { ...@@ -600,42 +630,42 @@ function jsonNew($data,$inChar="GBK",$outChar="UTF-8") {
*/ */
function strIconv($strInput,$inChar="GBK",$outChar="UTF-8"){ function strIconv($strInput,$inChar="GBK",$outChar="UTF-8"){
if(is_array($strInput)){ if(is_array($strInput)){
$strOutput = array(); $strOutput = array();
foreach($strInput as $key=>$val){ foreach($strInput as $key=>$val){
$key = strIconv($key,$inChar,$outChar); $key = strIconv($key,$inChar,$outChar);
$strOutput[$key] = strIconv($val,$inChar,$outChar); $strOutput[$key] = strIconv($val,$inChar,$outChar);
} }
}else{ }else{
$strOutput = iconv($inChar,$outChar,$strInput); $strOutput = iconv($inChar,$outChar,$strInput);
} }
if($strOutput !== false) if($strOutput !== false)
return $strOutput; return $strOutput;
else else
return $strInput; return $strInput;
} }
//通过curl模拟post的请求; //通过curl模拟post的请求;
function SendDataByCurl($url,$data=array()){ function SendDataByCurl($url,$data=array()){
//对空格进行转义 //对空格进行转义
$url = str_replace(' ','+',$url); $url = str_replace(' ','+',$url);
$ch = curl_init(); $ch = curl_init();
//设置选项,包括URL //设置选项,包括URL
curl_setopt($ch, CURLOPT_URL, "$url"); curl_setopt($ch, CURLOPT_URL, "$url");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch,CURLOPT_TIMEOUT,3); //定义超时3秒钟 curl_setopt($ch,CURLOPT_TIMEOUT,3); //定义超时3秒钟
// POST数据 // POST数据
curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POST, 1);
// 把post的变量加上 // 把post的变量加上
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data)); //所需传的数组用http_bulid_query()函数处理一下,就ok了 curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data)); //所需传的数组用http_bulid_query()函数处理一下,就ok了
//执行并获取url地址的内容 //执行并获取url地址的内容
$output = curl_exec($ch); $output = curl_exec($ch);
$errorCode = curl_errno($ch); $errorCode = curl_errno($ch);
//释放curl句柄 //释放curl句柄
curl_close($ch); curl_close($ch);
if(0 !== $errorCode) { if(0 !== $errorCode) {
return false; return false;
...@@ -646,19 +676,19 @@ function SendDataByCurl($url,$data=array()){ ...@@ -646,19 +676,19 @@ function SendDataByCurl($url,$data=array()){
function getJiaUserID($uid_str){ function getJiaUserID($uid_str){
$post['userid'] = $uid_str; $post['userid'] = $uid_str;
$personal_api_url = "http://jia.wuhan.house365.com/api/index.php?app=get_passport_uid"; $personal_api_url = "http://jia.wuhan.house365.com/api/index.php?app=get_passport_uid";
$json = SendDataByCurl($personal_api_url,$post); $json = SendDataByCurl($personal_api_url,$post);
$return = (json_decode($json, true)); $return = (json_decode($json, true));
if($return['status']==1){ if($return['status']==1){
return $return['data'][$uid_str]; return $return['data'][$uid_str];
} }
} }
......
...@@ -40,31 +40,31 @@ ...@@ -40,31 +40,31 @@
function getLoginInfoBySSO(){ function getLoginInfoBySSO(){
if(empty($_COOKIE['sso_token'])){ // if(empty($_COOKIE['sso_token'])){
return false; // return false;
} // }
$ci = & get_instance(); // $ci = & get_instance();
if(empty($_COOKIE['esfuserid']) || empty($_COOKIE['esfpassword'])){ // if(empty($_COOKIE['esfuserid']) || empty($_COOKIE['esfpassword'])){
$url = 'http://api.house365.com/passport/check_login_bytoken.php?sso_token='.$_COOKIE['sso_token']; // $url = 'http://api.house365.com/passport/check_login_bytoken.php?sso_token='.$_COOKIE['sso_token'];
$info = json_decode(curl_get_contents($url),1); // $info = json_decode(curl_get_contents($url),1);
if(is_array($info)){ // if(is_array($info)){
if (isset($info['data']['passport_uid']) && $info['data']['passport_uid']) { // if (isset($info['data']['passport_uid']) && $info['data']['passport_uid']) {
$passport_uid = $info['data']['passport_uid']; // $passport_uid = $info['data']['passport_uid'];
$ci->load->model('user_model'); // $ci->load->model('user_model');
$user = $ci->user_model->get_data(array('form_name' => 'personal_user','where'=>array('passport_uid'=>$passport_uid),'select'=>array('id','telno','password')),'esfbak'); // $user = $ci->user_model->get_data(array('form_name' => 'personal_user','where'=>array('passport_uid'=>$passport_uid),'select'=>array('id','telno','password')),'esfbak');
if($user){ // if($user){
$esfuserid = $user[0]['id']; // $esfuserid = $user[0]['id'];
$esfpassword = $user[0]['password']; // $esfpassword = $user[0]['password'];
setcookie('esfuserid',$esfuserid,time() + 3600 * 24 * 7,'/','.house365.com'); // setcookie('esfuserid',$esfuserid,time() + 3600 * 24 * 7,'/','.house365.com');
setcookie('esfpassword',$esfpassword,time() + 3600 * 24 * 7,'/','.house365.com'); // setcookie('esfpassword',$esfpassword,time() + 3600 * 24 * 7,'/','.house365.com');
} // }
} // }
}else{ // }else{
return false; // return false;
} // }
} // }
//
return $info; // return $info;
} }
function getLoginInfoBySSOUcenter(){ function getLoginInfoBySSOUcenter(){
......
...@@ -58,6 +58,22 @@ class Package_model extends MY_Model ...@@ -58,6 +58,22 @@ class Package_model extends MY_Model
return time() . $formatType . $randValue; return time() . $formatType . $randValue;
} }
/**
* 获取某个产品的0元支付交易号
* @param int $type 产品类型 1代表首页推荐,2代表列表页推荐,3代表智能刷新,4代表普通刷新
* @return string
*/
public function getPaymentTransactionId($type)
{
//防止订单ID与租售宝重复,$type 定义为从50开始
$type = 50 + $type;
$formatType = self::formatValue($type, 2);
//随机数
$randValue = self::formatValue(self::randValue(), 4);
//订单号
return 'zeropay-' . time() . $formatType . $randValue;
}
/** /**
* 获取套餐详情 * 获取套餐详情
* @param int $id 套餐ID * @param int $id 套餐ID
...@@ -552,6 +568,11 @@ class Package_model extends MY_Model ...@@ -552,6 +568,11 @@ class Package_model extends MY_Model
//订单状态更新成功,设置缓存5分钟内不再允许更新 //订单状态更新成功,设置缓存5分钟内不再允许更新
$this->memcached_class->add( $cacheKey, 1, 300 ); $this->memcached_class->add( $cacheKey, 1, 300 );
//更新优惠券
if (GB_CITY == 'nj' && (int)$orderInfo['coupon_id'] > 0) {
$this->updateCouponStatus( $orderInfo['user_id'], $orderInfo['coupon_id'] );
}
$data = array(); $data = array();
$tableArray = array( 1 => 'sell' , 2 => 'rent'); $tableArray = array( 1 => 'sell' , 2 => 'rent');
$tbl = $tableArray[$orderInfo['house_type']]; $tbl = $tableArray[$orderInfo['house_type']];
...@@ -947,6 +968,18 @@ class Package_model extends MY_Model ...@@ -947,6 +968,18 @@ class Package_model extends MY_Model
} }
/**
* 验证优惠券
* @param $user_id
* @param $coupon_id
*/
public function updateCouponStatus( $user_id, $coupon_id ) {
$url = GB_UPDATE_COUPON_URL . '?uid=' . $user_id .'&coupon_id=' . $coupon_id;
$couponRes = curl_get_contents( $url );
$couponRes = !empty( $couponRes ) ? json_decode( $couponRes, 1 ) : array();
return $couponRes;
}
/** /**
* 远程获取 * 远程获取
* @author zj * @author zj
...@@ -968,4 +1001,42 @@ class Package_model extends MY_Model ...@@ -968,4 +1001,42 @@ class Package_model extends MY_Model
curl_close($ch); curl_close($ch);
return $str; return $str;
} }
/**
* 发送消息
* @author zj
* @date 2020-09-08
*
* @param array $orderInfo 订单数据
* @return bool
*/
public function sendMsg( $orderInfo ) {
$message = '';
$this->load->library("apply_class");
if ( $orderInfo['package_type'] == 1 ) {
$message = "您已成功购买{$orderInfo['package_days']}天的首页推荐套餐,购买的套餐可以在个人中心-我的订单进行查看。";
} else if ( $orderInfo['package_type'] == 2 ) {
$message = "您已成功购买{$orderInfo['package_days']}天的列表页推荐套餐,购买的套餐可以在个人中心-我的订单进行查看。";
} else if ( $orderInfo['package_type'] == 3 ) {
$message = "您已成功购买{$orderInfo['package_days']}天的智能刷新套餐,购买的套餐可以在个人中心-我的订单进行查看。";
} else if ( $orderInfo['package_type'] == 6 ) {
$message = "您已成功购买24小时{$orderInfo['refresh_num']}次刷新,您可以选择手动去刷新或者设置时间预约刷新,购买的套餐可以在个人中心-我的订单进行查看哦";
}
if ( !$message ) {
return false;
}
//发送用户中心消息
$subject = '购买套餐成功。';
$this->apply_class->send_systemmsg( $orderInfo['user_id'], $subject, $message, 7, GB_CITY );
//发送短信
$telno = isset( $orderInfo['house_tel'] ) ? $orderInfo['house_tel'] : '';
if ( $telno ) {
sendsms( $telno, $message, 'sx' );
}
return true;
}
} }
\ No newline at end of file
...@@ -806,7 +806,13 @@ class User_model extends MY_Model ...@@ -806,7 +806,13 @@ class User_model extends MY_Model
if($jmz==1){ 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'); $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{ }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'); //获取base_id
$base_id_where = $this->get_base_id($uid,0,1);
if($base_id_where){
$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');
}
} }
...@@ -827,14 +833,24 @@ class User_model extends MY_Model ...@@ -827,14 +833,24 @@ class User_model extends MY_Model
*/ */
function getusercollectid($uid,$houseid,$city=GB_CITY,$kind="") function getusercollectid($uid,$houseid,$city=GB_CITY,$kind="")
{ {
$where_string = " collect_id = $houseid and city_name='$city'";
//如果有base_id优先走base_id
$base_id_where = $this->get_base_id($uid,0,1);
if($base_id_where){
$where_string .= " and base_id in ($base_id_where)";
}else{
$where_string .= " and uid = $uid";
}
//如果有kind
if($kind){ if($kind){
$return = $this->get_data(array('form_name' => 'personal_collection','where'=>array('uid'=>$uid,'collect_id'=>$houseid,'city_name'=>$city,'kind'=>$kind),'select'=>array('id')),'esf'); $where_string .= " and kind = $kind";
}
}else{
$return = $this->get_data(array('form_name' => 'personal_collection','where'=>array('uid'=>$uid,'collect_id'=>$houseid,'city_name'=>$city),'select'=>array('id')),'esf');
}
// $return = $this->get_data(array('form_name' => 'personal_collection','where'=>$where_string,'select'=>array('id')),'esf');
$sql = "select id from personal_collection where ".$where_string;
$query = $this->db_esfbak->query($sql);
$return = $query->result_array();
writelog(':查询用户是否收藏: '.print_r($return,1), 'fangliyan_'.date('d') );
if(!empty($return[0])) if(!empty($return[0]))
{ {
return $return[0]; return $return[0];
...@@ -878,6 +894,41 @@ class User_model extends MY_Model ...@@ -878,6 +894,41 @@ class User_model extends MY_Model
} }
} }
/**
* 通过base_id查询用户关注房源的房源id
* @param type $base_id
* @return string|array
*/
function getCollectHouseIdByBaseID($base_id,$kind,$houseid,$city=GB_CITY,$all=0){
$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 id from personal_collection where base_id in ($base_id_where) and collect_id = $houseid and city_name = '$city' and kind = $kind";
$query = $this->db_esfbak->query($sql);
$data = $query->result_array();
if(!empty($data[0]))
{
$res = array();
foreach ($data as $key => $value) {
$res[$key] = $value['id'];
}
if($all){
return $res;
}
return $res[0];
}else{
return 0;
}
}
/** /**
* 查询是否有此用户 * 查询是否有此用户
...@@ -936,7 +987,11 @@ class User_model extends MY_Model ...@@ -936,7 +987,11 @@ class User_model extends MY_Model
*/ */
function addcollect($uid,$collect_id,$kind,$collect_value,$city=GB_CITY,$infofrom=1,$passport_uid=0) function addcollect($uid,$collect_id,$kind,$collect_value,$city=GB_CITY,$infofrom=1,$passport_uid=0)
{ {
$arr = array('uid'=>$uid,'collect_id'=>$collect_id,'kind'=>$kind,'collect_value'=>$collect_value,'collect_time'=>time(),'city_name'=>$city,'infofrom'=>$infofrom,'passport_uid'=>$passport_uid); $base_id = $this->get_base_id($uid);
//取第一个
$one_base_id = explode(',',$base_id);
$arr = array('base_id'=>$one_base_id,'uid'=>$uid,'collect_id'=>$collect_id,'kind'=>$kind,'collect_value'=>$collect_value,'collect_time'=>time(),'city_name'=>$city,'infofrom'=>$infofrom,'passport_uid'=>$passport_uid);
writelog(':保存收藏addcollect: '.print_r($arr,1), 'fangliyan_'.date('d') );
//设置表 //设置表
$this->user_model->set_table('personal_collection'); $this->user_model->set_table('personal_collection');
//过滤表结构 //过滤表结构
...@@ -945,6 +1000,26 @@ class User_model extends MY_Model ...@@ -945,6 +1000,26 @@ class User_model extends MY_Model
return $result; return $result;
} }
/**
* 添加关注
* @param string $base_id
* @param string $collect_id
* @return string
*/
function addcollectByBaseID($base_id,$collect_id,$kind,$collect_value,$city=GB_CITY,$infofrom=1,$passport_uid=0,$uid=0)
{
//取base_id字符串中逗号前面的部分作为base_id
$base_id = explode(',',$base_id);
$base_id = $base_id[0];
$arr = array('base_id'=>$base_id,'uid'=>$uid,'collect_id'=>$collect_id,'kind'=>$kind,'collect_value'=>$collect_value,'collect_time'=>time(),'city_name'=>$city,'infofrom'=>$infofrom,'passport_uid'=>$passport_uid);
//设置表
$this->user_model->set_table('personal_collection');
//过滤表结构
$result = $this->user_model->add($arr,'esf');
return $result;
}
/** /**
* 推广情况 * 推广情况
* @param type $uid * @param type $uid
...@@ -1043,15 +1118,33 @@ class User_model extends MY_Model ...@@ -1043,15 +1118,33 @@ class User_model extends MY_Model
$this->memcached_class->delete($key); $this->memcached_class->delete($key);
} }
$collect_array = $this->memcached_class->get($key); // $collect_array = $this->memcached_class->get($key);
if(empty($collect_array) ) if(empty($collect_array) )
{ {
//获取base_id
$base_id_where = $this->get_base_id($uid,0,1);
if($base_id_where){
$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');
}
$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){ foreach($collect_array as &$value){
$collect_value = unserialize($value['collect_value']); $collect_value = unserialize($value['collect_value']);
if($value['kind'] == 2 && empty($collect_value)) {
//转化成utf-8
$collect_value = mb_convert_encoding($value['collect_value'], 'UTF-8', 'GBK');
$collect_value = unserialize($collect_value);
if ($collect_value) {
//转化成gbk
foreach ($collect_value as $key => $a) {
$collect_value[$key] = mb_convert_encoding($a, 'GBK', 'UTF-8');
}
}
}
if(is_array($collect_value)){ if(is_array($collect_value)){
if($collect_value['infofrom'] == 5){ if($collect_value['infofrom'] == 5){
if($city == 'nj'){ if($city == 'nj'){
...@@ -1132,9 +1225,10 @@ class User_model extends MY_Model ...@@ -1132,9 +1225,10 @@ class User_model extends MY_Model
* getSeachcondStr 转化找房条件 * getSeachcondStr 转化找房条件
* *
* @param array $sarr * @param array $sarr
* @param string $tab 出租/处说
* @return array * @return array
*/ */
function getSeachcondStr($sarr) function getSeachcondStr($sarr, $tab = 'sell')
{ {
global $house; global $house;
...@@ -1276,7 +1370,9 @@ class User_model extends MY_Model ...@@ -1276,7 +1370,9 @@ class User_model extends MY_Model
if( isset( $search['buildarea'] ) && $search['buildarea'] > 0 && $search['buildarea']!=99) if( isset( $search['buildarea'] ) && $search['buildarea'] > 0 && $search['buildarea']!=99)
{ {
$str .= isset($house['buildarea'][$search['buildarea']]) ? $house['buildarea'][$search['buildarea']].'<em class="t-line">|</em>' : ''; $buildareaArr = $house['buildarea'];
if ($tab == 'rent') $buildareaArr = !empty($house['rent_buildarea']) ? $house['rent_buildarea'] : array() ;
$str .= isset($buildareaArr[$search['buildarea']]) ? $buildareaArr[$search['buildarea']].'<em class="t-line">|</em>' : '';
} }
else else
{ {
...@@ -1651,7 +1747,7 @@ class User_model extends MY_Model ...@@ -1651,7 +1747,7 @@ class User_model extends MY_Model
if( empty($housedetail) ) if( empty($housedetail) )
{ {
$wherecond = $this->getsearchcond($searcharr); $wherecond = $this->getsearchcond($searcharr, $tbl);
if(!empty($datatime)) if(!empty($datatime))
{ {
...@@ -1672,7 +1768,7 @@ class User_model extends MY_Model ...@@ -1672,7 +1768,7 @@ class User_model extends MY_Model
if(isset($selldetail['Record'][0])) if(isset($selldetail['Record'][0]))
{ {
$housedetail = $selldetail['Record'][0]; $housedetail = $selldetail['Record'][0];
$housedetail['time'] = time_tran($housedetail['UPDATETIME']); $housedetail['time'] = !empty( $housedetail['UPDATETIME'] ) ? mb_convert_encoding(time_tran($housedetail['UPDATETIME']),'gbk','utf-8') : '';
$streetname = $this->block_model->getstreetname($housedetail['STREETID']); $streetname = $this->block_model->getstreetname($housedetail['STREETID']);
$housedetail['streetname'] = $streetname['streetname']; $housedetail['streetname'] = $streetname['streetname'];
} }
...@@ -1687,9 +1783,10 @@ class User_model extends MY_Model ...@@ -1687,9 +1783,10 @@ class User_model extends MY_Model
/** /**
* 根据搜索条件获得sql * 根据搜索条件获得sql
* @param type $searcharr * @param type $searcharr
* @param string $tab
* @return string * @return string
*/ */
function getsearchcond($searcharr) function getsearchcond($searcharr, $tab = 'sell')
{ {
GLOBAL $house; GLOBAL $house;
...@@ -1863,6 +1960,7 @@ class User_model extends MY_Model ...@@ -1863,6 +1960,7 @@ class User_model extends MY_Model
{ {
//搜索面板条件 //搜索面板条件
$where_buildarea_sell = empty($house['buildarea'][$searcharr['buildarea']])? '' : $house['buildarea'][$searcharr['buildarea']]; $where_buildarea_sell = empty($house['buildarea'][$searcharr['buildarea']])? '' : $house['buildarea'][$searcharr['buildarea']];
if ($tab == 'rent') $where_buildarea_sell = empty($house['rent_buildarea'][$searcharr['buildarea']])? '' : $house['rent_buildarea'][$searcharr['buildarea']];
if(!empty($where_buildarea_sell)) if(!empty($where_buildarea_sell))
{ {
...@@ -2415,6 +2513,9 @@ if($searcharr['infotype']==4){ ...@@ -2415,6 +2513,9 @@ if($searcharr['infotype']==4){
{ {
//设置表 //设置表
$this->user_model->set_table('personal_collection'); $this->user_model->set_table('personal_collection');
if(is_array($arr)){
$arr = implode(',',$arr);
}
//过滤表结构 //过滤表结构
$result = $this->user_model->del_mul($arr,'id','esf'); $result = $this->user_model->del_mul($arr,'id','esf');
return $result; return $result;
...@@ -2574,9 +2675,9 @@ if($searcharr['infotype']==4){ ...@@ -2574,9 +2675,9 @@ if($searcharr['infotype']==4){
function get_buy_by_uid($uid,$offset=0,$pagesize=0,$sendtime='') function get_buy_by_uid($uid,$offset=0,$pagesize=0,$sendtime='')
{ {
if(!empty($sendtime)){ if(!empty($sendtime)){
$buy_array = $this->get_data(array('form_name' => 'buy','where'=>array('uid'=>$uid,'esta'=>1,'creattime >'=>$sendtime),'limit'=>$offset,'offset'=>$pagesize,'order_by'=>'id DESC','select'=>array('matched_num','id','infotype','infofrom','address','buildyear','buildyear1','buildyear2','buildarea1','buildarea2','room','price1','price2','remark','allow_match','creattime','esta','telno')),'esfhousebak'); $buy_array = $this->get_data(array('form_name' => 'buy','where'=>array('uid'=>$uid,'esta'=>1,'creattime >'=>$sendtime),'limit'=>$pagesize,'offset'=>$offset,'order_by'=>'id DESC','select'=>array('matched_num','id','infotype','infofrom','address','buildyear','buildyear1','buildyear2','buildarea1','buildarea2','room','price1','price2','remark','allow_match','creattime','esta','telno')),'esfhousebak');
}else{ }else{
$buy_array = $this->get_data(array('form_name' => 'buy','where'=>array('uid'=>$uid,'esta'=>1),'limit'=>$offset,'offset'=>$pagesize,'order_by'=>'id DESC','select'=>array('matched_num','id','infotype','infofrom','address','buildyear','buildyear1','buildyear2','buildarea1','buildarea2','room','price1','price2','remark','allow_match','creattime','esta','telno')),'esfhousebak'); $buy_array = $this->get_data(array('form_name' => 'buy','where'=>array('uid'=>$uid,'esta'=>1),'limit'=>$pagesize,'offset'=>$offset,'order_by'=>'id DESC','select'=>array('matched_num','id','infotype','infofrom','address','buildyear','buildyear1','buildyear2','buildarea1','buildarea2','room','price1','price2','remark','allow_match','creattime','esta','telno')),'esfhousebak');
} }
if(is_array($buy_array) && !empty($buy_array) && GB_CITY=='nj') if(is_array($buy_array) && !empty($buy_array) && GB_CITY=='nj')
{ {
...@@ -4584,11 +4685,21 @@ if($searcharr['infotype']==4){ ...@@ -4584,11 +4685,21 @@ if($searcharr['infotype']==4){
$this->memcached_class->delete($key); $this->memcached_class->delete($key);
} }
$block = $this->memcached_class->get($key); // $block = $this->memcached_class->get($key);
if( empty($block) ) if( empty($block) )
{ {
$block_array = $this->get_data(array('form_name' => 'personal_collection','where'=>array('uid'=>$uid,'city_name'=>$city,'collect_id <>'=>0,'kind'=>2),'select'=>array('collect_id')),'esfbak'); //获取base_id
$base_id_where = $this->get_base_id($uid,0,1);
if($base_id_where){
$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 ";
$query = $this->db_esfbak->query($sql);
$block_array = $query->result_array();
}else{
$block_array = $this->get_data(array('form_name' => 'personal_collection','where'=>array('uid'=>$uid,'city_name'=>$city,'collect_id <>'=>0,'kind'=>2),'select'=>array('collect_id')),'esfbak');
}
if(is_array($block_array) && !empty($block_array)) if(is_array($block_array) && !empty($block_array))
{ {
...@@ -4598,7 +4709,16 @@ if($searcharr['infotype']==4){ ...@@ -4598,7 +4709,16 @@ if($searcharr['infotype']==4){
} }
} }
$sell_array = $this->get_data(array('form_name' => 'personal_collection','where'=>array('uid'=>$uid,'city_name'=>$city,'collect_id <>'=>0,'kind'=>3),'select'=>array('collect_id')),'esfbak'); if($base_id_where){
$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";
$query = $this->db_esfbak->query($sql);
$sell_array = $query->result_array();
}else{
$sell_array = $this->get_data(array('form_name' => 'personal_collection','where'=>array('uid'=>$uid,'city_name'=>$city,'collect_id <>'=>0,'kind'=>3),'select'=>array('collect_id')),'esfbak');
}
if(is_array($sell_array) && !empty($sell_array)) if(is_array($sell_array) && !empty($sell_array))
{ {
...@@ -4620,7 +4740,14 @@ if($searcharr['infotype']==4){ ...@@ -4620,7 +4740,14 @@ if($searcharr['infotype']==4){
} }
} }
$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($base_id_where){
$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";
$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)) if(is_array($rent_array) && !empty($rent_array))
{ {
...@@ -5813,7 +5940,7 @@ if($searcharr['infotype']==4){ ...@@ -5813,7 +5940,7 @@ if($searcharr['infotype']==4){
$passport_info = $this->get_data(array('form_name' => 'personal_user','limit'=>1,'where'=>array('id'=>$uid),'select'=>array('passport_uid')),'esfbak'); $passport_info = $this->get_data(array('form_name' => 'personal_user','limit'=>1,'where'=>array('id'=>$uid),'select'=>array('passport_uid')),'esfbak');
if ($passport_info) { if ($passport_info) {
$passport_uid =$passport_info['0']['passport_uid']; $passport_uid =$passport_info['0']['passport_uid'];
$url ="http://api.house365.com/passport/passport_changephone.php?come_from=1&passport_uid=".$passport_uid."&phoneold=".$oldPhone."&phone=".$newPhone; // $url ="http://api.house365.com/passport/passport_changephone.php?come_from=1&passport_uid=".$passport_uid."&phoneold=".$oldPhone."&phone=".$newPhone;
// get_api($url); // get_api($url);
} }
} }
...@@ -6114,6 +6241,91 @@ if($searcharr['infotype']==4){ ...@@ -6114,6 +6241,91 @@ if($searcharr['infotype']==4){
return $collect_array; 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'.$base_id.$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
* @param $coupon_id
* @param $price
* @param $packageType
*/
public function checkCoupon( $user_id, $coupon_id, $price, $packageType) {
$url = GB_CHECK_COUPON_URL . '?uid=' . $user_id .'&coupon_id=' . $coupon_id . '&price=' . $price . '&package_type=' . $packageType;
$couponRes = curl_get_contents( $url );
$couponRes = !empty( $couponRes ) ? json_decode( $couponRes, 1 ) : array();
return $couponRes;
}
/**
* 验证优惠券
* @param $order_code
* @param $user_id
* @param $coupon_id
* @param $price
* @param $packageType
*/
public function useCoupon( $order_code, $user_id, $coupon_id, $price, $packageType ) {
$params = array(
'order_code' => $order_code,
'coupon_id' => $coupon_id,
'price' => $price,
'uid' => $user_id,
'package_type' => $packageType,
);
$url = GB_USE_COUPON_URL;
$couonRes = $this->request_post( $url, $params );
$couonRes = !empty( $couonRes ) ? json_decode( $couonRes, 1 ) : array();
return $couonRes;
}
/**
* 记录日志
* @param $params
*/
public function addLog( $msg, $content ) {
$url = GB_ADD_LOG_URL;
$res = $this->request_post( $url, array( 'msg' => iconv('gbk', 'utf-8', $msg), 'content' => $content ) );
return $res;
}
function request_post($url = '', $param = '') { function request_post($url = '', $param = '') {
if (empty($url) || empty($param)) { if (empty($url) || empty($param)) {
return false; return false;
...@@ -6131,5 +6343,56 @@ if($searcharr['infotype']==4){ ...@@ -6131,5 +6343,56 @@ if($searcharr['infotype']==4){
return $data; return $data;
} }
/**
* 获取用户信息
* @param $uid int
* @param $passport_uid int
* @param $in_where int 是否要作为sql 拼接条件
* @return string
*/
public function get_base_id($uid=0,$passport_uid=0,$in_where=0)
{
if(!$uid && !$passport_uid) return '';
if(!$passport_uid){
$user_array = $this->get_data(array('form_name' => 'personal_user','where'=>array('id'=>$uid),'select'=>array('passport_uid')),'esfbak');
if(!empty($user_array)){
$passport_uid = $user_array[0]['passport_uid'];
}else{
return '';
}
}
$base_id_url = 'http://newrent.house365.com/api/tf-app/get-base-id?keyword='.$passport_uid;
$base_id = curl_get_contents($base_id_url);
$res = $base_id;
if($base_id){
if($in_where){
$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,',');
}
$res = $base_id_where;
}
}
return $res;
}
//获取用户购买二维码
public function getBuyQrImg($uid){
$url = 'http://newrentlocal.house365.com/api/tf-app-ext/get-order-qrimg?user_id='.$uid;
$result = curl_get_contents($url);
$result = $result ? json_decode($result,1) : array();
if(empty($result) || empty($result['data'])){
return '';
}
return $result['data']['qrimg'];
}
} }
\ No newline at end of file
...@@ -5694,8 +5694,8 @@ class User_Xue_model extends MY_Model ...@@ -5694,8 +5694,8 @@ class User_Xue_model extends MY_Model
$passport_info = $this->get_data(array('form_name' => 'personal_user','limit'=>1,'where'=>array('id'=>$uid),'select'=>array('passport_uid')),'esfbak'); $passport_info = $this->get_data(array('form_name' => 'personal_user','limit'=>1,'where'=>array('id'=>$uid),'select'=>array('passport_uid')),'esfbak');
if ($passport_info) { if ($passport_info) {
$passport_uid =$passport_info['0']['passport_uid']; $passport_uid =$passport_info['0']['passport_uid'];
$url ="http://api.house365.com/passport/passport_changephone.php?come_from=1&passport_uid=".$passport_uid."&phoneold=".$oldPhone."&phone=".$newPhone; // $url ="http://api.house365.com/passport/passport_changephone.php?come_from=1&passport_uid=".$passport_uid."&phoneold=".$oldPhone."&phone=".$newPhone;
get_api($url); // get_api($url);
} }
} }
......
...@@ -409,10 +409,10 @@ class User_Zhou_model extends MY_Model ...@@ -409,10 +409,10 @@ class User_Zhou_model extends MY_Model
{ {
$passport_uid =$passport_info['0']['passport_uid']; $passport_uid =$passport_info['0']['passport_uid'];
$url ="http://api.house365.com/passport/passport_changepwd.php?passport_uid=".$passport_uid."&passport_pwd=".$passport_pwd."&passport_new_pwd=".$passport_new_pwd; // $url ="http://api.house365.com/passport/passport_changepwd.php?passport_uid=".$passport_uid."&passport_pwd=".$passport_pwd."&passport_new_pwd=".$passport_new_pwd;
//echo $url;die; //echo $url;die;
get_api($url); // get_api($url);
} }
} }
...@@ -432,9 +432,9 @@ class User_Zhou_model extends MY_Model ...@@ -432,9 +432,9 @@ class User_Zhou_model extends MY_Model
{ {
$passport_uid =$passport_info['0']['passport_uid']; $passport_uid =$passport_info['0']['passport_uid'];
$url ="http://api.house365.com/passport/passport_changepwd.php?passport_uid=".$passport_uid."&phoneold=".$phoneold."&phone=".$phone; // $url ="http://api.house365.com/passport/passport_changepwd.php?passport_uid=".$passport_uid."&phoneold=".$phoneold."&phone=".$phone;
//
get_api($url); // get_api($url);
} }
} }
......
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