Commit e328c618 authored by fangliyan's avatar fangliyan

测试

parent f04d2740
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
...@@ -17,6 +17,8 @@ class MY_Model extends CI_Model ...@@ -17,6 +17,8 @@ class MY_Model extends CI_Model
$this->db_esfhouse = $this->load->database('dsn_esfhouse',true); $this->db_esfhouse = $this->load->database('dsn_esfhouse',true);
$this->db_esfhousebak = $this->load->database('dsn_esfhousebak',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'); $this->load->library('server',array('appName'=>NS_SELL,'strCheckMethod'=>"",'returnMethod'=>"ary",'returnCharSet'=>"gbk"),'server_sell');
...@@ -304,6 +306,14 @@ class MY_Model extends CI_Model ...@@ -304,6 +306,14 @@ class MY_Model extends CI_Model
$this->db = $this->db_esfhousebak; $this->db = $this->db_esfhousebak;
break; break;
case 'esfhousedev':
$this->db = $this->db_esfhousedev;
break;
case 'esfuserdev':
$this->db = $this->db_esfuserdev;
break;
default: default:
$this->db = $this->db_esf; $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