作者 郭鑫
1 个管道 的构建 通过 耗费 1 秒

位置

@@ -22,15 +22,15 @@ class CommentController extends HomeBaseController @@ -22,15 +22,15 @@ class CommentController extends HomeBaseController
22 public function _initialize() 22 public function _initialize()
23 { 23 {
24 parent::_initialize(); // TODO: Change the autogenerated stub 24 parent::_initialize(); // TODO: Change the autogenerated stub
25 - Session::set('uid','3');  
26 -// $wx = new WxloginController();  
27 -// $where_member['id'] = Session::get('uid');  
28 -// $member = Db::name('Member')->where($where_member)->find();  
29 -// if($member['status'] == 8){  
30 -// $this->apiResponse('0','您已被拉黑');  
31 -// }else if(empty($member['name'])){  
32 -// $this->apiResponse('0','请先实名认证',url('Index/index'));  
33 -// } 25 +
  26 + $wx = new WxloginController();
  27 + $where_member['id'] = Session::get('uid');
  28 + $member = Db::name('Member')->where($where_member)->find();
  29 + if($member['status'] == 8){
  30 + $this->apiResponse('0','您已被拉黑');
  31 + }else if(empty($member['name'])){
  32 + $this->apiResponse('0','请先实名认证',url('Index/index'));
  33 + }
34 34
35 } 35 }
36 36
@@ -25,6 +25,12 @@ class IndexController extends CommentController @@ -25,6 +25,12 @@ class IndexController extends CommentController
25 public function index() 25 public function index()
26 { 26 {
27 // 判断是否是首次进入 27 // 判断是否是首次进入
  28 + $acctoken = $this->getAccessToken();
  29 + $url = "https://api.weixin.qq.com/cgi-bin/user/get?access_token=".$acctoken."&next_openid=";
  30 + $isFollowContent = file_get_contents($url);
  31 + $json = json_decode($isFollowContent);
  32 +
  33 +
28 $where_member['id'] = Session::get('uid'); 34 $where_member['id'] = Session::get('uid');
29 $member = Db::name('Member')->where($where_member)->field('name,tel,card_num')->find(); 35 $member = Db::name('Member')->where($where_member)->field('name,tel,card_num')->find();
30 if(empty($member['name']) || empty($member['tel']) || empty($member['card_num'])){ 36 if(empty($member['name']) || empty($member['tel']) || empty($member['card_num'])){