Пример #1
0
 public function check_open_id($open_id)
 {
     $qq_reader_mod = new QQReaderModule();
     return $qq_reader_info = $qq_reader_mod->check_open_id($open_id);
 }
Пример #2
0
 public function save_user_part($user, $open_id, $type)
 {
     // 检查open_id
     $qq_reader_mod = new QQReaderModule();
     $qq_reader_info = $qq_reader_mod->check_open_id($open_id);
     if ($qq_reader_info) {
         // 不是第一次登陆
         $user_info = $this->get_by_id($qq_reader_info->user->id);
         return $user_info;
     } else {
         // 是第一次登陆
         $userModule = new UserModule($user->uuid);
         $is_nick_name = $userModule->check_name($user->name);
         $name_temp = "";
         if ($is_nick_name != 1) {
             $name_temp = $user->name;
             $user->name = $user->name . $this->create_uuid();
         }
         $userMod = new UserModule($this->user->uuid);
         $user_id = $userMod->save_user_part($user, $name_temp, $type);
         // 保存 qq_open_id  reader_id
         if ($user_id) {
             $qq_reader_mod->save_qq_reader($open_id, $user_id);
             $user_info = $this->get_by_id($user_id);
             return $user_info;
         }
         return null;
     }
 }