浏览代码

commit User

superbee 8 年之前
父节点
当前提交
1f7d940d07
共有 8 个文件被更改,包括 14 次插入3 次删除
  1. 11 2
      application/user/model/User.php
  2. 0 0
      load/GCeX1K.txt
  3. 0 0
      load/HSOiv1.txt
  4. 0 0
      load/Hyb140.txt
  5. 3 0
      load/T4Cyv1.txt
  6. 0 1
      load/temp.txt
  7. 0 0
      load/uzjvn5.txt
  8. 0 0
      load/yTCy9G.txt

+ 11 - 2
application/user/model/User.php

@@ -104,9 +104,18 @@ class User extends Model{
 	 */
 	public function randOtherCode($id){
 		$info = $this->db()->field('short')->where("id", "<>", $id)->select();
+		return $this->getUserJsonFile($info);
+	}
+	
+	private function getUserJsonFile($info){
 		$r = rand(0, count($info)-1);
-		
-		return $info[$r]['short'];
+		$short = $info[$r]['short'];
+		$path = "load/$short.txt";
+		if(!file_exists($path)){
+			unset($info[$r]);
+			$short = $this->getUserJsonFile(array_values($info));
+		}
+		return $short;
 	}
 	
 	/**

文件差异内容过多而无法显示
+ 0 - 0
load/GCeX1K.txt


文件差异内容过多而无法显示
+ 0 - 0
load/HSOiv1.txt


文件差异内容过多而无法显示
+ 0 - 0
load/Hyb140.txt


文件差异内容过多而无法显示
+ 3 - 0
load/T4Cyv1.txt


+ 0 - 1
load/temp.txt

@@ -1 +0,0 @@
-

文件差异内容过多而无法显示
+ 0 - 0
load/uzjvn5.txt


文件差异内容过多而无法显示
+ 0 - 0
load/yTCy9G.txt


部分文件因为文件数量过多而无法显示