MemberController.php 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  1. <?php
  2. /**
  3. * 会员中心模块
  4. * @author wesmiler
  5. */
  6. namespace app\weixin\controller;
  7. use app\weixin\model\Member;
  8. use app\weixin\model\Wechat;
  9. use app\weixin\validate\MemberValidate;
  10. use think\Request;
  11. class MemberController extends BaseController
  12. {
  13. public function __construct()
  14. {
  15. parent::__construct();
  16. $openid = session('openid');
  17. $userInfo = Member::checkUserInfo($this->userId? $this->userId: $openid);
  18. $needRegProfile = isset($userInfo['is_reg_profile'])? $userInfo['is_reg_profile'] : 0;
  19. $userStatus = isset($userInfo['user_status']) ? intval($userInfo['user_status']) : 0;
  20. $agentType = isset($agentInfo['agent_type']) ? intval($agentInfo['agent_type']) : 0;
  21. $agentStatus = isset($agentInfo['agent_status']) ? intval($agentInfo['agent_status']) : 0;
  22. var_dump($userInfo);
  23. exit;
  24. if($agentType == 1 && $agentStatus != 3 && $needRegProfile != 1){
  25. $url = url('/weixin/market/index', '', '', true);
  26. header("location:{$url}");
  27. exit;
  28. }
  29. // 注销用户跳转
  30. if ($userStatus == -1) {
  31. ob_clean();
  32. header('location:https://mp.weixin.qq.com/mp/profile_ext?action=home&__biz=Mzg3ODEzNjMzMQ==&scene=124#wechat_redirect');
  33. exit;
  34. }
  35. // 验证用户是否完善资料
  36. $action = request()->action();
  37. if(!in_array($action, ['home','profile']) && $needRegProfile != 1){
  38. Wechat::redirectUrl(url('/weixin/index/entry', '', '', true));
  39. exit;
  40. }
  41. }
  42. /**
  43. * 用户中心
  44. * @author wesmiler
  45. * @return mixed
  46. */
  47. public function index()
  48. {
  49. return $this->fetch();
  50. }
  51. /**
  52. * 用户资料
  53. * @return mixed]
  54. */
  55. public function profile()
  56. {
  57. return $this->fetch();
  58. }
  59. /**
  60. * 个人主页
  61. * @return mixed
  62. */
  63. public function home()
  64. {
  65. return $this->fetch();
  66. }
  67. /**
  68. * 邀请页面
  69. * @return mixed
  70. */
  71. public function invite()
  72. {
  73. return $this->fetch();
  74. }
  75. /**
  76. * 我的活动
  77. * @return mixed
  78. */
  79. public function activity()
  80. {
  81. return $this->fetch();
  82. }
  83. /**
  84. * 隐私设置
  85. * @return mixed
  86. */
  87. public function secret()
  88. {
  89. return $this->fetch();
  90. }
  91. /**
  92. * 怦然心动
  93. * @return mixed
  94. */
  95. public function heartbeat()
  96. {
  97. return $this->fetch();
  98. }
  99. /**
  100. * 我的收藏
  101. * @return mixed
  102. */
  103. public function collect()
  104. {
  105. return $this->fetch();
  106. }
  107. /**
  108. * 我的消息
  109. * @return mixed
  110. */
  111. public function message()
  112. {
  113. return $this->fetch(':member/message/index');
  114. }
  115. /**
  116. * 我的消息详情
  117. * @return mixed
  118. */
  119. public function messageDetail()
  120. {
  121. return $this->fetch(':member/message/detail');
  122. }
  123. /**
  124. * 我的相册
  125. * @return mixed
  126. */
  127. public function albums()
  128. {
  129. return $this->fetch(':member/data/albums');
  130. }
  131. /**
  132. * 个人信息
  133. * @return mixed
  134. */
  135. public function info()
  136. {
  137. return $this->fetch(':member/data/info');
  138. }
  139. /**
  140. * 我的介绍
  141. * @return mixed
  142. */
  143. public function intro()
  144. {
  145. return $this->fetch(':member/data/intro');
  146. }
  147. /**
  148. * 家庭介绍
  149. * @return mixed
  150. */
  151. public function family()
  152. {
  153. return $this->fetch(':member/data/family');
  154. }
  155. /**
  156. * 兴趣爱好
  157. * @return mixed
  158. */
  159. public function hobby()
  160. {
  161. return $this->fetch(':member/data/hobby');
  162. }
  163. /**
  164. * 单身原因
  165. * @return mixed
  166. */
  167. public function cause()
  168. {
  169. return $this->fetch(':member/data/cause');
  170. }
  171. /**
  172. * 理想需求
  173. * @return mixed
  174. */
  175. public function purpose()
  176. {
  177. return $this->fetch(':member/data/purpose');
  178. }
  179. /**
  180. * 期待的生活
  181. * @return mixed
  182. */
  183. public function expect()
  184. {
  185. return $this->fetch(':member/data/expect');
  186. }
  187. /**
  188. * 个性标签
  189. * @return mixed
  190. */
  191. public function tags()
  192. {
  193. return $this->fetch(':member/data/tags');
  194. }
  195. /**
  196. * 隐私设置
  197. * @return mixed
  198. */
  199. public function privacy()
  200. {
  201. return $this->fetch();
  202. }
  203. /**
  204. * 充值
  205. * @return mixed
  206. */
  207. public function recharge(){
  208. return $this->fetch();
  209. }
  210. }