...
|
...
|
@@ -20,26 +20,27 @@ use Plugin\Captcha; |
|
|
class PassportModel
|
|
|
{
|
|
|
|
|
|
const REGISTER_LEFT_BANNER_CODE = 'c479ec90120cae7f96e52922b4917064';//注册左边的banner
|
|
|
const BACK_LFFT_BANNER_CODE = '3bbaf502c447a2ddad60879042e286d8';//找回密码左边的banner
|
|
|
const SIGNIN_LEFT_BANNER_CODE ='db350894e01e90eac55cd3a13ad77331';//登录页左边的banner
|
|
|
const AUTOUSERINFO_LEFT_BANNER_CODE ='c62d5da06d843b6ed78d8d27e87fa143';//完善信息页左边的banner
|
|
|
const REGISTER_LEFT_BANNER_CODE = 'c479ec90120cae7f96e52922b4917064'; //注册左边的banner
|
|
|
const BACK_LFFT_BANNER_CODE = '3bbaf502c447a2ddad60879042e286d8'; //找回密码左边的banner
|
|
|
const SIGNIN_LEFT_BANNER_CODE = 'db350894e01e90eac55cd3a13ad77331'; //登录页左边的banner
|
|
|
const AUTOUSERINFO_LEFT_BANNER_CODE = 'c62d5da06d843b6ed78d8d27e87fa143'; //完善信息页左边的banner
|
|
|
const BACK_FIND_SECRET_KEY = '_+@#$%^';
|
|
|
|
|
|
|
|
|
//简单头部
|
|
|
public static function getSimpleHeader($isLogin, $username = '')
|
|
|
{
|
|
|
//拼接简单头部
|
|
|
$tool = array(
|
|
|
'favoriteHref' => Helpers::url('/home/favorite/index'), //我的收藏链接
|
|
|
'couponHref' => Helpers::url('/home/coupons/index'), //我的优惠券链接
|
|
|
'orderHref' => Helpers::url('/home/orders/index'), //订单中心连接
|
|
|
'favoriteHref' => Helpers::url('/home/favorite?t=' . time()), //我的收藏链接
|
|
|
'couponHref' => Helpers::url('/home/coupons?t=' . time()), //我的优惠券链接
|
|
|
'orderHref' => Helpers::url('/home/orders?t=' . time()), //订单中心连接
|
|
|
'helpHref' => Helpers::url('/help'),
|
|
|
);
|
|
|
if ($isLogin) {
|
|
|
$tool+=array(
|
|
|
'user' => $username,
|
|
|
'userCenter' => Helpers::url('/home/index'), //用户中心链接
|
|
|
'logoutHref' => Helpers::url('/passport/signout/index'), //退出
|
|
|
'userCenter' => Helpers::url('/home?t=' . time()), //用户中心链接
|
|
|
'logoutHref' => Helpers::url('/logout.html?t=' . time()), //退出
|
|
|
);
|
|
|
}
|
|
|
else {
|
...
|
...
|
@@ -68,13 +69,13 @@ class PassportModel |
|
|
*/
|
|
|
public static function getLeftBanner($code)
|
|
|
{
|
|
|
$ret = array('img'=>'','url'=>'');
|
|
|
$ret = array('img' => '', 'url' => '');
|
|
|
$resource = IndexData::getResourceData($code);
|
|
|
if(isset($resource['data'][0]))
|
|
|
{
|
|
|
if($resource['data'][0]['template_name'] == 'single_image') {
|
|
|
if (isset($resource['data'][0])) {
|
|
|
if ($resource['data'][0]['template_name'] == 'single_image') {
|
|
|
$val = current($resource['data'][0]['data']);
|
|
|
} else if($resource['data'][0]['template_name'] == 'single_name_image') {
|
|
|
}
|
|
|
else if ($resource['data'][0]['template_name'] == 'single_name_image') {
|
|
|
$val = $resource['data'][0]['data'];
|
|
|
}
|
|
|
$ret['img'] = Images::getImageUrl($val['src'], 252, 190);
|
...
|
...
|
@@ -86,7 +87,7 @@ class PassportModel |
|
|
}
|
|
|
return $ret;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 校验验证码
|
|
|
*
|
...
|
...
|
@@ -98,12 +99,12 @@ class PassportModel |
|
|
$verifyCode = strtolower($verifyCode);
|
|
|
$ret = true;
|
|
|
//检测验证码不正确
|
|
|
if($verifyCode != strtolower(Captcha::getFromSession('passport_istration'))) {
|
|
|
if ($verifyCode != strtolower(Captcha::getFromSession('passport_istration'))) {
|
|
|
$ret = false;
|
|
|
}
|
|
|
return $ret;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 根据手机号获取用户信息
|
|
|
*
|
...
|
...
|
@@ -111,31 +112,34 @@ class PassportModel |
|
|
* @param string $mobile
|
|
|
* @return array
|
|
|
*/
|
|
|
public static function getUserInfoByMobile($area, $mobile) {
|
|
|
public static function getUserInfoByMobile($area, $mobile)
|
|
|
{
|
|
|
$ret = array();
|
|
|
$data = UserData::getUserInfoByMobile($area, $mobile);
|
|
|
if($data['code'] == 200) {
|
|
|
if(!empty($data['data'])) {
|
|
|
if ($data['code'] == 200) {
|
|
|
if (!empty($data['data'])) {
|
|
|
$ret = current($data['data']);
|
|
|
}
|
|
|
}
|
|
|
return $ret;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 根据邮箱获取用户信息
|
|
|
*
|
|
|
* @param string $email
|
|
|
* @return array
|
|
|
*/
|
|
|
public static function getUserInfoByEmail($email) {
|
|
|
public static function getUserInfoByEmail($email)
|
|
|
{
|
|
|
$ret = array();
|
|
|
$data = UserData::getUserInfoByEmail($email);
|
|
|
if($data['code'] == 200) {
|
|
|
if(!empty($data['data'])) {
|
|
|
if ($data['code'] == 200) {
|
|
|
if (!empty($data['data'])) {
|
|
|
$ret = current($data['data']);
|
|
|
}
|
|
|
}
|
|
|
return $ret;
|
|
|
}
|
|
|
|
|
|
} |
...
|
...
|
|