Commit 18ed1e2e authored by fangliyan's avatar fangliyan

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

Subscribe2.0

查看合并请求 !29
parents 2c286207 2e0d36c7
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -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";
$IpHostAllow =explode('.',get_ip());
if($IpHostAllow['0']=='127')
{
$conf_db_host ='njesfdbmastervip.house365.com';
......@@ -123,23 +124,6 @@ $db['dsn_esfbak']['swap_pre'] = '';
$db['dsn_esfbak']['autoinit'] = FALSE;
$db['dsn_esfbak']['stricton'] = FALSE;
$db['dsn_esfuser_dev']['hostname'] = '192.168.105.107';
$db['dsn_esfuser_dev']['username'] = 'root';
$db['dsn_esfuser_dev']['password'] = 'd53b21ffb24d9c34';
$db['dsn_esfuser_dev']['database'] = 'user';
$db['dsn_esfuser_dev']['dbdriver'] = 'mysql';
$db['dsn_esfuser_dev']['dbprefix'] = '';
$db['dsn_esfuser_dev']['pconnect'] = FALSE;
$db['dsn_esfuser_dev']['db_debug'] = FALSE;
$db['dsn_esfuser_dev']['cache_on'] = FALSE;
$db['dsn_esfuser_dev']['cachedir'] = '';
$db['dsn_esfuser_dev']['char_set'] = 'gbk';
$db['dsn_esfuser_dev']['dbcollat'] = 'gbk';
$db['dsn_esfuser_dev']['swap_pre'] = '';
$db['dsn_esfuser_dev']['autoinit'] = FALSE;
$db['dsn_esfuser_dev']['stricton'] = FALSE;
if(GB_CITY=='nj')
{
$db['dsn_esfhouse']['hostname'] = $conf_db_host;
......@@ -174,22 +158,6 @@ if(GB_CITY=='nj')
$db['dsn_esfhousebak']['autoinit'] = FALSE;
$db['dsn_esfhousebak']['stricton'] = FALSE;
$db['dsn_esfhouse_dev']['hostname'] = '192.168.105.107';
$db['dsn_esfhouse_dev']['username'] = 'root';
$db['dsn_esfhouse_dev']['password'] = 'd53b21ffb24d9c34';
$db['dsn_esfhouse_dev']['database'] = 'house';
$db['dsn_esfhouse_dev']['dbdriver'] = 'mysql';
$db['dsn_esfhouse_dev']['dbprefix'] = '';
$db['dsn_esfhouse_dev']['pconnect'] = FALSE;
$db['dsn_esfhouse_dev']['db_debug'] = FALSE;
$db['dsn_esfhouse_dev']['cache_on'] = FALSE;
$db['dsn_esfhouse_dev']['cachedir'] = '';
$db['dsn_esfhouse_dev']['char_set'] = 'gbk';
$db['dsn_esfhouse_dev']['dbcollat'] = 'gbk';
$db['dsn_esfhouse_dev']['swap_pre'] = '';
$db['dsn_esfhouse_dev']['autoinit'] = FALSE;
$db['dsn_esfhouse_dev']['stricton'] = FALSE;
}elseif(GB_CITY=='hf'){
$db['dsn_esfhouse']['hostname'] = $conf_db_host;
$db['dsn_esfhouse']['username'] = 'root';
......
......@@ -17,8 +17,6 @@ class MY_Model extends CI_Model
$this->db_esfhouse = $this->load->database('dsn_esfhouse',true);
$this->db_esfhousebak = $this->load->database('dsn_esfhousebak',true);
$this->db_esfhousedev = $this->load->database('dsn_esfhouse_dev',true);
$this->db_esfuserdev = $this->load->database('dsn_esfuser_dev',true);
$this->load->library('server',array('appName'=>NS_SELL,'strCheckMethod'=>"",'returnMethod'=>"ary",'returnCharSet'=>"gbk"),'server_sell');
......@@ -306,14 +304,6 @@ class MY_Model extends CI_Model
$this->db = $this->db_esfhousebak;
break;
case 'esfhousedev':
$this->db = $this->db_esfhousedev;
break;
case 'esfuserdev':
$this->db = $this->db_esfuserdev;
break;
default:
$this->db = $this->db_esf;
}
......
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
/**
* @author cxf
*/
class Dev_User_class
{
public function __construct()
{
}
function user_login($result,$password='',$telno='',$name='')
{
//隐藏手机号部分数字
$pattern = "/(1\d{1,2})\d\d(\d{0,3})/";
$replacement = "\$1*****\$3";
$telno2 = preg_replace($pattern, $replacement, trim($telno));
$showname = $telno2 ? $telno2 : $name ;
$CI = &get_instance();
$CI->load->model('user_model');
$esfmesnum = $CI->user_model->getmessagenumbyuidwd($result);
if($telno=='')
{
$temp = $CI->user_model->getuserdetailUcenter($result);
$telno = $temp['telno'];
}
$password_encrypt = passport_encrypt($password);
//设置COOKIE
vbsetcookie("esfuserid","",1);
vbsetcookie("esfpassword","",1);
vbsetcookie("esfstyleid","",1);
vbsetcookie("esfusertelno","",1);
vbsetcookie("esfusername","",1);
vbsetcookie("esfshowname","",1);
vbsetcookie("esfmesnum","",1);
vbsetcookie("ckinfo","",1);
vbsetcookie("sessionhash","",1);
vbsetcookie("esfuserid",$result);
vbsetcookie("esfpassword",$password);
vbsetcookie("esfusername",$name);
vbsetcookie("esfusertelno",$telno);
vbsetcookie("esfusercity",GB_CITY);
vbsetcookie('lastvisit','',0);
vbsetcookie("esfshowname",$showname);
vbsetcookie("esf".GB_CITY."mesnum",$esfmesnum);
//逐步替代password,最终去掉password的cookie,增加安全性
vbsetcookie("esf_encrypt",$password_encrypt);
//登录SESSION
$array = array( 'esfuserid'=>$result , 'esfpassword'=>$password ,'esfusername'=>$name , 'esfusertelno'=>$telno ,'esfusercity'=>GB_CITY,'esfshowname'=>$showname,'esfmesnum'=>$esfmesnum);
$CI->load->library('session');
$CI->session->set_userdata($array);
/* 登录日志记录 */
$CI->load->model('user_statistic_model');
//初始化用户信息
$CI->user_statistic_model->set_uid($result);
$CI->user_statistic_model->set_city(GB_CITY);
//提交登录信息
$CI->user_statistic_model->sub_login_log();
$CI->load->model('user_model');
//查询上次登录时间
$last_logintime = $CI->user_model->getuserdetailUcenter($result);
if(date("Y-m-d",$last_logintime['lastlogintime']) != date("Y-m-d"))
{
//查询小区是否有新房源
$msg1 = $CI->user_model->getnewblockhouse($result,$last_logintime['lastlogintime']);
$CI->load->library("apply_class");
if(is_array($msg1) && !empty($msg1))
{
$string = implode(',',$msg1);
//发送消息
$subject = '您关注的小区有新的房源。';
$msg = '您关注的小区“'.$string.'”有新的房源发布,<a href="'.USER_CENTER.'user/blocklist">点击查看</a>。';
$CI->apply_class->send_systemmsg($result,$subject,$msg,2,GB_CITY);
}
//查询找房条件是否有新房源
$result = $CI->user_model->getnewtjhouse($result,$last_logintime['lastlogintime']);
if($result == 1)
{
//发送消息
$subject = '您关注的找房条件有新的房源。';
$msg = '您关注的找房条件有新的房源。<a href="'.USER_CENTER.'user/sell_condition">点击查看</a>。';
$CI->apply_class->send_systemmsg($result,$subject,$msg,2,GB_CITY);
}
}
return 1;
}
}
\ No newline at end of file
This diff is collapsed.
<?php
if (!defined('BASEPATH'))
exit('No direct script access allowed');
class dev_broker_model extends MY_Model
{
function __construct()
{
parent::__construct();
}
/**
* ȡ
* @param type $uid
* @return array
*/
function getbrokerdetail($uid)
{
$key = $this->memkey.'_getbrokerdetail_'.$uid;
if($this->input->get('update') == 1)
{
$this->memcached_class->delete($key);
}
$broker = $this->memcached_class->get($key);
if( empty($broker) )
{
$broker = $this->get_data(array('form_name' => 'broker','where'=>array('uid'=>$uid),'select'=>array('uid','truename','agentcode','username','telno','smallphoto')),'esfhousebak');
if(isset($broker[0]['agentcode']) && !empty($broker[0]['agentcode']))
{
$agent = $this->get_data(array('form_name' => 'agency','where'=>array('agentcode'=>$broker[0]['agentcode']),'select'=>array('agid','agentshortname')),'esfhousebak');
$broker[0]['agentshortname'] = $agent[0]['agentshortname'];
$broker[0]['agid'] = $agent[0]['agid'];
}
$this->memcached_class->add($key, $broker,3600);
}
if(!empty($broker[0]))
{
return $broker[0];
}else{
return 0;
}
}
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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