dever 4 years ago
parent
commit
07862b1b5a
3 changed files with 21 additions and 3 deletions
  1. 17 0
      app/collection/database/page.php
  2. 2 2
      app/collection/lib/Content.php
  3. 2 1
      app/collection/src/Api.php

+ 17 - 0
app/collection/database/page.php

@@ -38,6 +38,12 @@ $search_times = function() use ($info_id)
 	return $array;
 };
 
+$bgmusic_autoplay = array
+(
+    1 => '自动播放',
+    2 => '不自动播放',
+);
+
 return array
 (
 	# 表名
@@ -141,6 +147,17 @@ return array
             'large'     => true,
         ),
 
+        'bgmusic_autoplay'       => array
+        (
+            'type'      => 'tinyint-1',
+            'name'      => '背景音乐自动播放',
+            'default'   => '1',
+            'desc'      => '背景音乐自动播放',
+            'match'     => 'option',
+            'update'    => 'radio',
+            'option'    => $bgmusic_autoplay,
+        ),
+
         'pic'     => array
         (
             'type'      => 'varchar-150',

+ 2 - 2
app/collection/lib/Content.php

@@ -19,7 +19,7 @@ class Content
     }
 
 	# 获取某一个合集的内容列表
-	public function getList($user, $info_id, $page_id, $show = true, $index = 0)
+	public function getList($user, $info_id, $page_id, $show = true, $index = 0, $page = array())
 	{
 		$where['info_id'] = $info_id;
         $where['page_id'] = $page_id;
@@ -29,7 +29,7 @@ class Content
 		if ($data) {
             $i = 0;
             # 获取章节信息
-            $page = Dever::db('collection/page')->one($page_id);
+            //$page = Dever::db('collection/page')->one($page_id);
             if ($page && $page['desc']) {
                 $parent_page = Dever::db('collection/page')->one($page['page_id']);
                 $page['parent_name'] = $parent_page['name'];

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

@@ -273,6 +273,7 @@ class Api extends Core
         $data['info_id'] = $this->id_code;
 
         $data['page_id'] = $this->page_id;
+        $data['page_info'] = Dever::db('collection/page')->one($page_id);
         $data['parent_page_id'] = $this->parent_page_id;
         $data['index'] = $this->index;
         $data['times_id'] = $this->times;
@@ -287,7 +288,7 @@ class Api extends Core
         $data['show'] = $this->checkView();
 
         # 获取每个模块
-        $data['items'] = Dever::load('collection/lib/content')->getList($this->user, $this->id, $this->page_id, $data['show'], $this->index);
+        $data['items'] = Dever::load('collection/lib/content')->getList($this->user, $this->id, $this->page_id, $data['show'], $this->index, $data['page_info']);
         # 滑动到多少时,加载下一页
         $data['total'] = count($data['items']) - 2;