dever 3 years ago
parent
commit
9586f1f40b
2 changed files with 33 additions and 4 deletions
  1. 18 1
      app/collection/src/Api.php
  2. 15 3
      main/database/config.php

+ 18 - 1
app/collection/src/Api.php

@@ -42,8 +42,25 @@ class Api extends Core
         return $file['url'];
     }
 
-    # home首页
+    # 获取首页
     public function home()
+    {
+        if ($this->uid < 0) {
+            $this->user['username'] = '游客';
+        }
+        $data['user'] = $this->user;
+
+        # 有多少余额
+        $data['score'] = Dever::load('score/lib/core')->getUserScore($this->uid);
+
+        # 基本配置
+        $data['config'] = Dever::db('main/config')->one();
+
+        return $data;
+    }
+
+    # 我的合集列表
+    public function getList()
     {
         # 获取推荐合集
         $data['hot'] = array();

+ 15 - 3
main/database/config.php

@@ -45,10 +45,10 @@ return array
 		
 		'info'		=> array
 		(
-			'type' 		=> 'text-255',
-			'name' 		=> '系统名称',
+			'type' 		=> 'varchar-1000',
+			'name' 		=> '系统描述',
 			'default' 	=> '',
-			'desc' 		=> '请输入系统名称',
+			'desc' 		=> '请输入系统描述',
 			'match' 	=> 'option',
 			'update'	=> 'textarea',
 		),
@@ -64,6 +64,18 @@ return array
 			'key' 		=> '1',
 			'place'		=> '150',
 		),
+
+		'home_top'		=> array
+		(
+			'type' 		=> 'varchar-150',
+			'name' 		=> '首页顶部图片',
+			'default' 	=> '',
+			'desc' 		=> '首页顶部图片',
+			'match' 	=> 'option',
+			'update'	=> 'image',
+			'key' 		=> '1',
+			'place'		=> '750*538',
+		),
 		
 		'cdate'		=> array
 		(