|
@@ -10,30 +10,30 @@
|
|
|
defined('InShopNC') or exit('Access Invalid!');
|
|
|
|
|
|
/********************************** 前台control父类 **********************************************/
|
|
|
-
|
|
|
class mobileControl
|
|
|
{
|
|
|
//客户端类型
|
|
|
protected $client_type_array = array('android', 'wap', 'wechat', 'ios');
|
|
|
//客户登录身份类型
|
|
|
- protected $client_login_type_array = array(0,1,2);
|
|
|
+ protected $client_login_type_array = array(0, 1, 2);
|
|
|
//列表默认分页数
|
|
|
protected $page = 5;
|
|
|
-
|
|
|
- public function __construct()
|
|
|
+
|
|
|
+ public function __construct()
|
|
|
{
|
|
|
Language::read('mobile');
|
|
|
//分页数处理
|
|
|
$page = intval($_GET['page']);
|
|
|
- if($page > 0) {
|
|
|
+ if ($page > 0) {
|
|
|
$this->page = $page;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-class mobileHomeControl extends mobileControl
|
|
|
+class mobileHomeControl extends mobileControl
|
|
|
{
|
|
|
- public function __construct() {
|
|
|
+ public function __construct()
|
|
|
+ {
|
|
|
parent::__construct();
|
|
|
}
|
|
|
}
|
|
@@ -41,30 +41,72 @@ class mobileHomeControl extends mobileControl
|
|
|
class mobileMemberControl extends mobileControl
|
|
|
{
|
|
|
protected $member_info = array();
|
|
|
-
|
|
|
- public function __construct()
|
|
|
+
|
|
|
+ public function __construct()
|
|
|
{
|
|
|
parent::__construct();
|
|
|
|
|
|
$model_mb_user_token = Model('mb_user_token');
|
|
|
$key = $_POST['key'];
|
|
|
- if(empty($key)) {
|
|
|
+ if (empty($key)) {
|
|
|
$key = $_GET['key'];
|
|
|
}
|
|
|
$mb_user_token_info = $model_mb_user_token->getMbUserTokenInfoByToken($key);
|
|
|
- if(empty($mb_user_token_info)) {
|
|
|
- return joutput_error(errcode::ErrLogin,'请登录');
|
|
|
+ if (empty($mb_user_token_info)) {
|
|
|
+ return joutput_error(errcode::ErrLogin, '请登录');
|
|
|
}
|
|
|
|
|
|
$model_member = Model('member');
|
|
|
$this->member_info = $model_member->getMemberInfoByID($mb_user_token_info['member_id']);
|
|
|
$this->member_info['client_type'] = $mb_user_token_info['client_type'];
|
|
|
- if(empty($this->member_info)) {
|
|
|
- return joutput_error(errcode::ErrLogin,'请登录');
|
|
|
+ if (empty($this->member_info)) {
|
|
|
+ return joutput_error(errcode::ErrLogin, '请登录');
|
|
|
} else {
|
|
|
//读取卖家信息
|
|
|
- $seller_info = Model('seller')->getSellerInfo(array('member_id'=>$this->member_info['member_id']));
|
|
|
+ $seller_info = Model('seller')->getSellerInfo(array('member_id' => $this->member_info['member_id']));
|
|
|
$this->member_info['store_id'] = $seller_info['store_id'];
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+/**
|
|
|
+ * Class mobileMemberControl
|
|
|
+ */
|
|
|
+class mobileMemberExControl extends mobileControl
|
|
|
+{
|
|
|
+ protected $member_info = array();
|
|
|
+
|
|
|
+ public $err_code = errcode::Success;
|
|
|
+
|
|
|
+ public function __construct()
|
|
|
+ {
|
|
|
+ parent::__construct();
|
|
|
+ }
|
|
|
+
|
|
|
+ public function checkToken($token)
|
|
|
+ {
|
|
|
+ $model_mb_user_token = Model('mb_user_token');
|
|
|
+ $mb_user_token_info = $model_mb_user_token->getMbUserTokenInfoByToken($token);
|
|
|
+ if (empty($mb_user_token_info)) {
|
|
|
+ $this->err_code = errcode::ErrLogin;
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 读取买家信息
|
|
|
+ $model_member = Model('member');
|
|
|
+ $this->member_info = $model_member->getMemberInfoByID($mb_user_token_info['member_id']);
|
|
|
+ $this->member_info['client_type'] = $mb_user_token_info['client_type'];
|
|
|
+ if (empty($this->member_info)) {
|
|
|
+ $this->err_code = errcode::ErrMemberNotExist;
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ //读取卖家信息
|
|
|
+ $seller_info = Model('seller')->getSellerInfo(array('member_id' => $this->member_info['member_id']));
|
|
|
+ $this->member_info['store_id'] = $seller_info['store_id'];
|
|
|
+
|
|
|
+ $this->err_code = errcode::Success;
|
|
|
+
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+}
|