| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300 |
- <?php
- /**
- * 会员中心模块
- * @author wesmiler
- */
- namespace app\weixin\controller;
- use app\weixin\model\Wechat;
- use app\weixin\model\Member;
- use think\Request;
- class MemberController extends BaseController
- {
- public function __construct()
- {
- parent::__construct();
- $openid = session('openid');
- $userInfo = Member::checkUserInfo($this->userId? $this->userId: $openid);
- $needRegProfile = isset($userInfo['is_reg_profile'])? $userInfo['is_reg_profile'] : 0;
- $userStatus = isset($userInfo['user_status']) ? intval($userInfo['user_status']) : 0;
- $agentType = isset($userInfo['agent_type']) ? intval($userInfo['agent_type']) : 0;
- $agentStatus = isset($userInfo['agent_status']) ? intval($userInfo['agent_status']) : 0;
- $action = request()->action();
- if($agentType == 1 && $agentStatus != 3 && ($needRegProfile != 1 || ($action != 'home' && $userStatus != 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 wechat()
- {
- return $this->fetch();
- }
- /**
- * 验证手机号
- * @return mixed
- */
- public function verifyMobile()
- {
- return $this->fetch();
- }
- /**
- * 个人主页
- * @return mixed
- */
- public function home()
- {
- $sid = input('sid', 0);
- if($sid){
- session('sid', input('sid', 0));
- }
- return $this->fetch();
- }
- /**
- * 邀请页面
- * @return mixed
- */
- public function invite()
- {
- return $this->fetch();
- }
- /**
- * 我的活动
- * @return mixed
- */
- public function activity()
- {
- return $this->fetch();
- }
- /**
- * 隐私设置
- * @return mixed
- */
- public function secret()
- {
- return $this->fetch();
- }
- /**
- * 怦然心动
- * @return mixed
- */
- public function heartbeat()
- {
- return $this->fetch();
- }
- /**
- * 我的收藏
- * @return mixed
- */
- public function collect()
- {
- return $this->fetch();
- }
- /**
- * 我的消息
- * @return mixed
- */
- public function message()
- {
- return $this->fetch(':member/message/index');
- }
- /**
- * 我的消息详情
- * @return mixed
- */
- public function messageDetail()
- {
- return $this->fetch(':member/message/detail');
- }
- /**
- * 我的访客
- * @return mixed
- */
- public function access()
- {
- return $this->fetch(':member/access/index');
- }
- /**
- * 我的相册
- * @return mixed
- */
- public function albums()
- {
- return $this->fetch(':member/data/albums');
- }
- /**
- * 个人信息
- * @return mixed
- */
- public function info()
- {
- return $this->fetch(':member/data/info');
- }
- /**
- * 我的介绍
- * @return mixed
- */
- public function intro()
- {
- return $this->fetch(':member/data/intro');
- }
- /**
- * 家庭介绍
- * @return mixed
- */
- public function family()
- {
- return $this->fetch(':member/data/family');
- }
- /**
- * 兴趣爱好
- * @return mixed
- */
- public function hobby()
- {
- return $this->fetch(':member/data/hobby');
- }
- /**
- * 单身原因
- * @return mixed
- */
- public function cause()
- {
- return $this->fetch(':member/data/cause');
- }
- /**
- * 理想需求
- * @return mixed
- */
- public function purpose()
- {
- return $this->fetch(':member/data/purpose');
- }
- /**
- * 期待的生活
- * @return mixed
- */
- public function expect()
- {
- return $this->fetch(':member/data/expect');
- }
- /**
- * 个性标签
- * @return mixed
- */
- public function tags()
- {
- return $this->fetch(':member/data/tags');
- }
- /**
- * 隐私设置
- * @return mixed
- */
- public function privacy()
- {
- return $this->fetch();
- }
- /**
- * 充值
- * @return mixed
- */
- public function recharge(){
- return $this->fetch();
- }
- /**
- * 举报用户列表
- * @return mixed
- */
- public function complain(){
- return $this->fetch();
- }
- /**
- * 举报用户
- * @return mixed
- */
- public function complainSubmit(){
- return $this->fetch();
- }
- /**
- * 用户建议
- * @return mixed|string
- */
- public function advice(){
- return $this->fetch();
- }
- /**
- * 签到
- * @return mixed]
- */
- public function signs()
- {
- return $this->fetch();
- }
- }
|