dever 4 years ago
parent
commit
d597ae71b2

+ 16 - 4
app/collection/database/content.php

@@ -88,6 +88,15 @@ return array
             'option'    => $type,
         ),
 
+        'type_id'      => array
+        (
+            'type'      => 'int-11',
+            'name'      => '类型id',
+            'default'   => '',
+            'desc'      => '类型id',
+            'match'     => 'is_numeric',
+        ),
+
         'name'      => array
         (
             'type'      => 'varchar-80',
@@ -104,13 +113,13 @@ return array
         'pic'     => array
         (
             'type'      => 'varchar-150',
-            'name'      => '封面图-封面图尺寸375*693,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式',
+            'name'      => '封面图-封面图尺寸150*150px,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式',
             'default'   => '',
             'desc'      => '封面图',
             'match'     => 'option',
             'update'    => 'image',
             'key'       => '1',
-            'place'     => '375*693',
+            'place'     => '150*150',
         ),
 
         'reorder'       => array
@@ -174,6 +183,7 @@ return array
             'option' => array
             (
                 'info_id' => 'yes',
+                'page_id' => 'yes',
                 'state' => 1,
             ),
             'type' => 'all',
@@ -188,10 +198,11 @@ return array
             'option' => array
             (
                 'info_id' => 'yes',
+                'page_id' => 'yes',
                 'state' => 1,
             ),
             'type' => 'one',
-            'order' => array('reorder' => 'desc', 'id' => 'desc'),
+            'order' => array('reorder' => 'asc', 'id' => 'desc'),
             'col' => '*',
         ),
 
@@ -202,9 +213,10 @@ return array
                 'state' => 1,
                 'page_id' => 'yes',
                 'info_id' => 'yes',
+                'type_id' => array(1, '>='),
             ),
             'type' => 'all',
-            'order' => array('reorder' => 'desc', 'id' => 'desc'),
+            'order' => array('reorder' => 'asc', 'id' => 'desc'),
             'col' => '*|page_id|',
         ),
     )

+ 14 - 1
app/collection/lib/Content.php

@@ -6,10 +6,23 @@ use Dever;
 
 class Content
 {
+    public function updateTypeId($id, $name, $data)
+    {
+        # 同步更新到content的type_id
+        $update['type_id'] = $id;
+        $content_id = Dever::param('content_id', $data);
+
+        if ($content_id) {
+            $update['where_id'] = $content_id;
+            Dever::db('collection/content')->update($update);
+        }
+    }
+
 	# 获取某一个合集的内容列表
-	public function getList($info_id)
+	public function getList($info_id, $page_id)
 	{
 		$where['info_id'] = $info_id;
+        $where['page_id'] = $page_id;
 		$data = Dever::db('collection/content')->getAllPage($where);
 
         $result = array();

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

@@ -27,7 +27,8 @@ class Api
     public function getContent()
     {
         $id = Dever::input('id');
-        $data['items'] = Dever::load('collection/lib/content')->getList($id);
+        $page_id = Dever::input('page_id');
+        $data['items'] = Dever::load('collection/lib/content')->getList($id, $page_id);
 
         return $data;
     }

+ 8 - 2
app/content/database/act.php

@@ -5,12 +5,18 @@ $status = Dever::config('base')->status;
 return array
 (
 	# 表名
-	'name' => 'news',
+	'name' => 'act',
 	# 显示给用户看的名称
-	'lang' => '图文内容',
+	'lang' => '活动',
 	'order' => 100,
 	'menu' => false,
 
+	'end' => array
+	(
+		'insert' => 'collection/lib/content.updateTypeId',
+		'update' => 'collection/lib/content.updateTypeId',
+	),
+
 	# 数据结构
 	'struct' => array
 	(

+ 6 - 0
app/content/database/audio.php

@@ -11,6 +11,12 @@ return array
 	'order' => 100,
 	'menu' => false,
 
+	'end' => array
+	(
+		'insert' => 'collection/lib/content.updateTypeId',
+		'update' => 'collection/lib/content.updateTypeId',
+	),
+
 	# 数据结构
 	'struct' => array
 	(

+ 6 - 0
app/content/database/audio_comment.php

@@ -11,6 +11,12 @@ return array
     'order' => 100,
     'menu' => false,
 
+    'end' => array
+    (
+        'insert' => 'collection/lib/content.updateTypeId',
+        'update' => 'collection/lib/content.updateTypeId',
+    ),
+
     # 数据结构
     'struct' => array
     (

+ 6 - 0
app/content/database/dialogue.php

@@ -24,6 +24,12 @@ return array
 	'order' => 100,
 	'menu' => false,
 
+    'end' => array
+    (
+        'insert' => 'collection/lib/content.updateTypeId',
+        'update' => 'collection/lib/content.updateTypeId',
+    ),
+
 	# 数据结构
 	'struct' => array
 	(

+ 6 - 0
app/content/database/link.php

@@ -11,6 +11,12 @@ return array
 	'order' => 100,
 	'menu' => false,
 
+	'end' => array
+	(
+		'insert' => 'collection/lib/content.updateTypeId',
+		'update' => 'collection/lib/content.updateTypeId',
+	),
+
 	# 数据结构
 	'struct' => array
 	(

+ 6 - 0
app/content/database/live.php

@@ -11,6 +11,12 @@ return array
 	'order' => 100,
 	'menu' => false,
 
+    'end' => array
+    (
+        'insert' => 'collection/lib/content.updateTypeId',
+        'update' => 'collection/lib/content.updateTypeId',
+    ),
+
 	# 数据结构
 	'struct' => array
 	(

+ 6 - 0
app/content/database/news.php

@@ -22,6 +22,12 @@ return array
 	'order' => 100,
 	'menu' => false,
 
+	'end' => array
+	(
+		'insert' => 'collection/lib/content.updateTypeId',
+		'update' => 'collection/lib/content.updateTypeId',
+	),
+
 	# 数据结构
 	'struct' => array
 	(

+ 6 - 0
app/content/database/pic.php

@@ -43,6 +43,12 @@ return array
 	'order' => 100,
 	'menu' => false,
 
+    'end' => array
+    (
+        'insert' => 'collection/lib/content.updateTypeId',
+        'update' => 'collection/lib/content.updateTypeId',
+    ),
+
 	# 数据结构
 	'struct' => array
 	(

+ 6 - 0
app/content/database/pic_grid.php

@@ -19,6 +19,12 @@ return array
 	'order' => 100,
 	'menu' => false,
 
+	'end' => array
+	(
+		'insert' => 'collection/lib/content.updateTypeId',
+		'update' => 'collection/lib/content.updateTypeId',
+	),
+
 	# 数据结构
 	'struct' => array
 	(

+ 6 - 0
app/content/database/product.php

@@ -31,6 +31,12 @@ return array
 	'order' => 100,
 	'menu' => false,
 
+	'end' => array
+	(
+		'insert' => 'collection/lib/content.updateTypeId',
+		'update' => 'collection/lib/content.updateTypeId',
+	),
+
 	# 数据结构
 	'struct' => array
 	(

+ 6 - 0
app/content/database/video.php

@@ -11,6 +11,12 @@ return array
 	'order' => 100,
 	'menu' => false,
 
+	'end' => array
+	(
+		'insert' => 'collection/lib/content.updateTypeId',
+		'update' => 'collection/lib/content.updateTypeId',
+	),
+	
 	# 数据结构
 	'struct' => array
 	(

+ 6 - 0
app/content/database/video_comment.php

@@ -11,6 +11,12 @@ return array
 	'order' => 100,
 	'menu' => false,
 
+	'end' => array
+	(
+		'insert' => 'collection/lib/content.updateTypeId',
+		'update' => 'collection/lib/content.updateTypeId',
+	),
+
 	# 数据结构
 	'struct' => array
 	(

+ 6 - 0
app/content/database/video_short.php

@@ -37,6 +37,12 @@ return array
 	'order' => 100,
 	'menu' => false,
 
+    'end' => array
+    (
+        'insert' => 'collection/lib/content.updateTypeId',
+        'update' => 'collection/lib/content.updateTypeId',
+    ),
+
 	# 数据结构
 	'struct' => array
 	(

+ 6 - 0
app/content/database/webview.php

@@ -11,6 +11,12 @@ return array
 	'order' => 100,
 	'menu' => false,
 
+	'end' => array
+	(
+		'insert' => 'collection/lib/content.updateTypeId',
+		'update' => 'collection/lib/content.updateTypeId',
+	),
+
 	# 数据结构
 	'struct' => array
 	(