MemberController.php 5.5 KB

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