MemberController.php 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  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. $ssid = input('ssid', 0);
  81. if($sid){
  82. session('sid', input('sid', 0));
  83. }
  84. if($ssid){
  85. session('ssid', input('ssid', 0));
  86. }
  87. return $this->fetch();
  88. }
  89. /**
  90. * 邀请页面
  91. * @return mixed
  92. */
  93. public function invite()
  94. {
  95. return $this->fetch();
  96. }
  97. /**
  98. * 我的活动
  99. * @return mixed
  100. */
  101. public function activity()
  102. {
  103. return $this->fetch();
  104. }
  105. /**
  106. * 隐私设置
  107. * @return mixed
  108. */
  109. public function secret()
  110. {
  111. return $this->fetch();
  112. }
  113. /**
  114. * 怦然心动
  115. * @return mixed
  116. */
  117. public function heartbeat()
  118. {
  119. return $this->fetch();
  120. }
  121. /**
  122. * 我的收藏
  123. * @return mixed
  124. */
  125. public function collect()
  126. {
  127. return $this->fetch();
  128. }
  129. /**
  130. * 我的消息
  131. * @return mixed
  132. */
  133. public function message()
  134. {
  135. return $this->fetch(':member/message/index');
  136. }
  137. /**
  138. * 我的消息详情
  139. * @return mixed
  140. */
  141. public function messageDetail()
  142. {
  143. return $this->fetch(':member/message/detail');
  144. }
  145. /**
  146. * 我的访客
  147. * @return mixed
  148. */
  149. public function access()
  150. {
  151. return $this->fetch(':member/access/index');
  152. }
  153. /**
  154. * 我的相册
  155. * @return mixed
  156. */
  157. public function albums()
  158. {
  159. return $this->fetch(':member/data/albums');
  160. }
  161. /**
  162. * 个人信息
  163. * @return mixed
  164. */
  165. public function info()
  166. {
  167. return $this->fetch(':member/data/info');
  168. }
  169. /**
  170. * 我的介绍
  171. * @return mixed
  172. */
  173. public function intro()
  174. {
  175. return $this->fetch(':member/data/intro');
  176. }
  177. /**
  178. * 家庭介绍
  179. * @return mixed
  180. */
  181. public function family()
  182. {
  183. return $this->fetch(':member/data/family');
  184. }
  185. /**
  186. * 兴趣爱好
  187. * @return mixed
  188. */
  189. public function hobby()
  190. {
  191. return $this->fetch(':member/data/hobby');
  192. }
  193. /**
  194. * 单身原因
  195. * @return mixed
  196. */
  197. public function cause()
  198. {
  199. return $this->fetch(':member/data/cause');
  200. }
  201. /**
  202. * 理想需求
  203. * @return mixed
  204. */
  205. public function purpose()
  206. {
  207. return $this->fetch(':member/data/purpose');
  208. }
  209. /**
  210. * 期待的生活
  211. * @return mixed
  212. */
  213. public function expect()
  214. {
  215. return $this->fetch(':member/data/expect');
  216. }
  217. /**
  218. * 个性标签
  219. * @return mixed
  220. */
  221. public function tags()
  222. {
  223. return $this->fetch(':member/data/tags');
  224. }
  225. /**
  226. * 隐私设置
  227. * @return mixed
  228. */
  229. public function privacy()
  230. {
  231. return $this->fetch();
  232. }
  233. /**
  234. * 充值
  235. * @return mixed
  236. */
  237. public function recharge(){
  238. return $this->fetch();
  239. }
  240. /**
  241. * 举报用户列表
  242. * @return mixed
  243. */
  244. public function complain(){
  245. return $this->fetch();
  246. }
  247. /**
  248. * 举报用户
  249. * @return mixed
  250. */
  251. public function complainSubmit(){
  252. return $this->fetch();
  253. }
  254. /**
  255. * 用户建议
  256. * @return mixed|string
  257. */
  258. public function advice(){
  259. return $this->fetch();
  260. }
  261. /**
  262. * 签到
  263. * @return mixed]
  264. */
  265. public function signs()
  266. {
  267. return $this->fetch();
  268. }
  269. }