| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131 |
- <?php
- /**
- * 会员中心模块
- * @author wesmiler
- */
- namespace app\weixin\controller;
- use app\weixin\model\Member;
- use app\weixin\model\Wechat;
- use app\weixin\validate\MemberValidate;
- use think\Request;
- class MemberController extends BaseController
- {
- public function __construct()
- {
- parent::__construct();
- $userStatus = isset($this->userInfo['user_status']) ? intval($this->userInfo['user_status']) : 0;
- $agentType = isset($this->userInfo['agent_type']) ? intval($this->userInfo['agent_type']) : 0;
- $agentStatus = isset($this->userInfo['agent_status']) ? intval($this->userInfo['agent_status']) : 0;
- $needRegProfile = isset($this->userInfo['is_reg_profile'])? $this->userInfo['is_reg_profile'] : 0;
- var_dump($this->userInfo);
- if($agentType == 1 && $agentStatus != 3 && $needRegProfile != 1){
- $url = url('/weixin/market/index', '', '', true);
- header("location:{$url}");
- exit;
- }
- // 注销用户跳转
- if ($userStatus == -1) {
- ob_clean();
- header('location:https://mp.weixin.qq.com/mp/profile_ext?action=home&__biz=Mzg3ODEzNjMzMQ==&scene=124#wechat_redirect');
- exit;
- }
- // 验证用户是否完善资料
- $action = request()->action();
- if(!in_array($action, ['home','profile']) && $needRegProfile != 1){
- Wechat::redirectUrl(url('/weixin/index/entry', '', '', true));
- exit;
- }
- }
- /**
- * 用户中心
- * @author wesmiler
- * @return mixed
- */
- public function index()
- {
- return $this->fetch();
- }
- /**
- * 用户资料
- * @return mixed]
- */
- public function profile()
- {
- return $this->fetch();
- }
- /**
- * 个人主页
- * @return mixed
- */
- public function home()
- {
- return $this->fetch();
- }
- /**
- * 邀请页面
- * @return mixed
- */
- public function invite()
- {
- return $this->fetch();
- }
- /**
- * 怦然心动
- * @return mixed
- */
- public function heartbeat()
- {
- return $this->fetch();
- }
- /**
- * 团队邀请
- * @return mixed
- */
- public function team_invite()
- {
- return $this->fetch();
- }
- /**
- * 我的团队
- * @return mixed
- */
- public function team()
- {
- return $this->fetch();
- }
- /**
- * 我的收藏
- * @return mixed
- */
- public function collect()
- {
- return $this->fetch();
- }
- /**
- * 我的消息
- * @return mixed
- */
- public function message()
- {
- return $this->fetch(':member/message/index');
- }
- }
|