Sfoglia il codice sorgente

修改用户无法存档的bug

gsgundam 7 anni fa
parent
commit
c5ae0b5fd6
1 ha cambiato i file con 3 aggiunte e 1 eliminazioni
  1. 3 1
      application/newhome/controller/User.php

+ 3 - 1
application/newhome/controller/User.php

@@ -84,8 +84,10 @@ class User extends Controller {
 		
 		$res = $this->userModel->getUserById($id);
 		if(empty($res)) return json(['error'=>1023]);
+
+        $oldversion = isset($res['version'])?$res['version']:1;
 		
-		if($version > $oldversion = $res['version']){
+		if($version > $oldversion){
 			// 读取旧文件
 			$old_file = fopen($path, "r") or die(json(['error'=>1009]));
 			$info = fread($old_file, filesize($path));