dever 4 năm trước cách đây
mục cha
commit
db1bb456a2
2 tập tin đã thay đổi với 31 bổ sung1 xóa
  1. 22 1
      app/collection/database/info.php
  2. 9 0
      app/collection/src/Api.php

+ 22 - 1
app/collection/database/info.php

@@ -34,6 +34,12 @@ $score = function()
     return $array;
 };
 
+$top = array
+(
+    1 => '推荐',
+    2 => '不推荐',
+);
+
 $score_type = array
 (
     1 => '全局积分',
@@ -404,6 +410,20 @@ $config = array
             //'edit'        => true,
         ),
 
+        'top'        => array
+        (
+            'type'      => 'int-11',
+            'name'      => '推荐',
+            'default'   => '2',
+            'desc'      => '推荐',
+            'match'     => 'is_numeric',
+            //'update'  => 'select',
+            'option'    => $top,
+            'search'    => 'select',
+            'list'      => true,
+            'edit'      => true,
+        ),
+
         'status'        => array
         (
             'type'      => 'int-11',
@@ -742,7 +762,7 @@ $config = array
             'option' => array
             (
                 //'audit' => 2,
-                'hot' => 1,
+                'top' => 1,
                 'buy' => 'yes',
                 'time' => array('yes-pdate', '<=', 'or)'),
                 'cate_id' => 'yes',
@@ -752,6 +772,7 @@ $config = array
             'type' => 'all',
             'order' => array('reorder' => 'desc', 'pdate' => 'desc', 'id' => 'desc'),
             //'page' => array(10, 'list'),
+            'limit' => '0,10',
             'col' => $col,
         ),
 

+ 9 - 0
app/collection/src/Api.php

@@ -45,6 +45,15 @@ class Api extends Core
     # home首页
     public function home()
     {
+        # 获取推荐合集
+        $data['hot'] = array();
+        $hot = Dever::db('collection/info')->getHot();
+        if ($hot) {
+            foreach ($hot as $k => $v) {
+                $data['hot'][] = $this->getOne($v['id']);
+            }
+        }
+
         # 获取我拥有的合集
         $data['info'] = array();
         $collection = Dever::load('user/lib/collection')->getList($this->uid);