Ejemplo n.º 1
0
 private function isLogin()
 {
     $uid = M('member_yott')->where(array('yott_name' => $this->sign['name']))->getField('id');
     if ($uid) {
         $this->yottLogin($uid) && self::redirect('/invest/' . $this->sign['identify']);
         return '';
     }
     //判断手机号是否存在
     $user = M('members')->where('user_phone="' . $this->sign['phone'] . '"')->Field('id,user_name')->find();
     if ($user) {
         M('member_yott')->add(array('uid' => $user['id'], 'startdate' => time(), 'startip' => sprintf("%u", ip2long(get_client_ip())), 'status' => 2, 'yott_name' => $this->sign['name']));
         if (import('App.Api.yott')) {
             $yott = new yott();
             $yott->bindUser($user['user_name'], $this->sign['phone'], 2);
         }
         $this->yottLogin($user['id']) && self::redirect('/invest/' . $this->sign['identify']);
         return '';
     }
     return $this->sign;
 }