dever 4 年之前
父節點
當前提交
7f92a59f87
共有 1 個文件被更改,包括 13 次插入13 次删除
  1. 13 13
      lib/Core.php

+ 13 - 13
lib/Core.php

@@ -91,21 +91,21 @@ class Core
 
 				return array('name' => $child['name'], 'score' => $score['score'] ? $score['score'] : 0);
 			}
+		}
+
+		if (!$config_id) {
+			$config = Dever::db('score/config')->one(array('type' => 1));
 		} else {
-			if (!$config_id) {
-				$config = Dever::db('score/config')->one(array('type' => 1));
-			} else {
-				$config = Dever::db('score/config')->one($config_id);
-			}
-			
-			if ($config) {
-				$where = array();
-				$where['uid'] = $uid;
-				$where['config_id'] = $config['id'];
-				$score = Dever::db('score/user')->one($where);
+			$config = Dever::db('score/config')->one($config_id);
+		}
+		
+		if ($config) {
+			$where = array();
+			$where['uid'] = $uid;
+			$where['config_id'] = $config['id'];
+			$score = Dever::db('score/user')->one($where);
 
-				return array('name' => $config['name'], 'score' => $score['score'] ? $score['score'] : 0);
-			}
+			return array('name' => $config['name'], 'score' => $score['score'] ? $score['score'] : 0);
 		}
 
 		return false;