dever 4 år sedan
förälder
incheckning
9d2057869d

+ 20 - 8
app/collection/database/info.php

@@ -164,6 +164,16 @@ $config = array
             'attr'      => '',
         ),
 
+        'ticket_name'      => array
+        (
+            'type'      => 'varchar-50',
+            'name'      => '门票名称-可以自定义门票的名称',
+            'default'   => '门票',
+            'desc'      => '门票名称',
+            'match'     => 'option',
+            'update'    => 'text',
+        ),
+
         'buy'       => array
         (
             'type'      => 'int-11',
@@ -434,18 +444,20 @@ $config = array
         # 列表
         'list_button' => array
         (
-            'update' => '编辑合集',
-            'br1' => array('<br />'),
-            'edit' => array('预览链接', str_replace('https://api.', 'http://www.', Dever::url('main/preview.get?type=4'))),
+            'edit' => array('预览', str_replace('https://api.', 'http://www.', Dever::url('main/preview.get?type=4'))),
+            'update' => '编辑',
             'br2' => array('<br />'),
-            'list10' => array('榜单列表', '"collection_ranking&project=act&search_type=4&search_option_collection_id={id}&oper_table=info&oper_project=collection"' , '{audit} == 1 && {buy} == 1'),
-            'add1' => array('榜单设置', '"ranking&project=collection&search_option_info_id={id}&oper_table=info&oper_project=collection&oper_save_jump=info&where_id={id}"', '{audit} == 1 && {buy} == 1'),
+
+            'list1' => array('功能', '"page&search_option_info_id={id}&oper_table=info&page_type=1"' , '{audit} == 1'),
+
+            'list2' => array('门票', '"buy&search_option_info_id={id}&oper_table=info"' , '{audit} == 1 && {buy} == 1'),
+
             'br3' => array('<br />'),
-            //'list' => array('内容管理', '"content&search_option_info_id={id}&oper_table=info&page_type=1"' , '{audit} == 1'),
 
-            'list2' => array('章节管理', '"page&search_option_info_id={id}&oper_table=info&page_type=1"' , '{audit} == 1'),
+            'list3' => array('章节', '"page&search_option_info_id={id}&oper_table=info&page_type=1"' , '{audit} == 1'),
+
+            'list4' => array('榜单', '"ranking&project=collection&search_option_info_id={id}&oper_table=info&oper_project=collection&where_id={id}"', '{audit} == 1'),
             
-            'list1' => array('门票管理', '"buy&search_option_info_id={id}&oper_table=info"' , '{audit} == 1 && {buy} == 1'),
         ),
     ),
 

+ 15 - 1
app/collection/database/page.php

@@ -35,6 +35,19 @@ return array
             'value'     => Dever::input('search_option_info_id')
         ),
 
+        'year'		=> array
+		(
+			'type' 		=> 'int-11',
+			'name' 		=> '年份-影响时光板块的内容选择',
+			'default' 	=> '',
+			'desc' 		=> '年份',
+			'match' 	=> 'is_numeric',
+			'update'	=> 'year',
+			'search'	=> 'text',
+			'order'		=> 'desc',
+			'list'		=> true,
+		),
+
 		'name'		=> array
 		(
 			'type' 		=> 'varchar-150',
@@ -93,7 +106,7 @@ return array
 			# 只有insert时才生效
 			'insert'	=> true,
 			'order'		=> 'asc',
-			'search'	=> 'date',
+			//'search'	=> 'date',
 			'list'		=> 'date("Y-m-d H:i:s", {cdate})',
 		),
 	),
@@ -121,6 +134,7 @@ return array
 				'state' => 1,
 				'page_id' => array(1, '>='),
 				'info_id' => 'yes',
+				'year' => 'yes',
 			),
 			'type' => 'all',
 			'order' => array('reorder' => 'asc', 'id' => 'asc'),

+ 53 - 10
app/collection/database/ranking.php

@@ -1,10 +1,27 @@
 <?php
 
+$type = array
+(
+    1 => '门票榜单',
+    2 => '购物榜单',
+    3 => '贡献榜单',
+    4 => '积分榜单',
+);
+
+$periods = array
+(
+    1 => '天',
+    2 => '周',
+    3 => '月',
+    4 => '年',
+);
+
 $status = array
 (
     1 => '开启',
     2 => '关闭',
 );
+
 return array
 (
     # 表名
@@ -45,6 +62,18 @@ return array
             'value'     => Dever::input('search_option_info_id')
         ),
 
+        'name'      => array
+        (
+            'type'      => 'varchar-80',
+            'name'      => '榜单标题',
+            'default'   => '',
+            'desc'      => '榜单标题',
+            'match'     => 'is_string',
+            'update'    => 'text',
+            'search'    => 'fulltext',
+            'list'      => true,
+        ),
+
         'status'     => array
         (
             'type'      => 'int-11',
@@ -54,17 +83,31 @@ return array
             'match'     => 'is_numeric',
             'update'    => 'radio',
             'option'    => $status,
+            'list'      => true,
+            'edit'      => true,
         ),
 
-        'name'      => array
+        'type'     => array
         (
-            'type'      => 'varchar-80',
-            'name'      => '榜单标题',
-            'default'   => '',
-            'desc'      => '榜单标题',
-            'match'     => 'is_string',
-            'update'    => 'text',
-            'search'    => 'fulltext',
+            'type'      => 'int-11',
+            'name'      => '榜单类型',
+            'default'   => '1',
+            'desc'      => '榜单类型',
+            'match'     => 'is_numeric',
+            'update'    => 'radio',
+            'option'    => $type,
+            'list'      => true,
+        ),
+
+        'periods'     => array
+        (
+            'type'      => 'int-11',
+            'name'      => '榜单周期',
+            'default'   => '1',
+            'desc'      => '榜单周期',
+            'match'     => 'is_numeric',
+            'update'    => 'radio',
+            'option'    => $periods,
             'list'      => true,
         ),
 
@@ -76,7 +119,7 @@ return array
             'match'     => 'option',
             'desc'      => '榜单开始时间',
             'update'    => 'date',
-            'list'      => 'date("Y-m-d H:i:s", {start})',
+            //'list'      => 'date("Y-m-d H:i:s", {start})',
             'callback'  => 'maketime',
         ),
 
@@ -88,7 +131,7 @@ return array
             'match'     => 'option',
             'desc'      => '榜单结束时间',
             'update'    => 'date',
-            'list'      => 'date("Y-m-d H:i:s", {end})',
+            //'list'      => 'date("Y-m-d H:i:s", {end})',
             'callback'  => 'maketime',
         ),
 

+ 4 - 0
app/collection/lib/Core.php

@@ -8,7 +8,11 @@ class Core
 {
     public function __construct()
     {
+    	# 获取当前的用户信息
         $this->token = Dever::input('token');
         $this->uid = 1;
+
+        # 获取最新的年份-时光专用
+        $this->year = Dever::input('year', date('Y'));
     }
 }

+ 14 - 3
app/collection/src/Api.php

@@ -31,8 +31,8 @@ class Api extends Core
         # 是否已经购买
         $data['is_buy'] = false;
         $data['button'] = array(
-            'style' => 'background: linear-gradient(to right, #000000,#000000) !important;',
-            'color' => '#fff',
+            'bgcolor' => 'background: linear-gradient(to right, #000000,#000000) !important;color:#fff;',
+            'color' => 'color:#fff',
             'name' => array('入口', '排行榜')
         );
         $data['info'] = Dever::db('collection/info')->one($id);
@@ -49,10 +49,20 @@ class Api extends Core
 
             $data['button']['name'] = explode(',', $data['info']['button']);
             if ($data['info']['button_bgcolor'] && $data['info']['button_bgjcolor']) {
-                $data['button']['style'] = 'background: linear-gradient(to right, '.$data['info']['button_bgcolor'].','.$data['info']['button_bgjcolor'].') !important;';
+                $data['button']['bgcolor'] = 'background: linear-gradient(to right, '.$data['info']['button_bgcolor'].','.$data['info']['button_bgjcolor'].') !important;';
             }
             if ($data['info']['button_ftcolor']) {
                 $data['button']['color'] = 'color:' . $data['info']['button_ftcolor'];
+                $data['button']['bgcolor'] .= $data['button']['color'];
+            }
+
+            # 获取最新的章节页id
+            $page_where['info_id'] = $data['info']['id'];
+            $page_where['year'] = $this->year;
+            $data['page'] = Dever::db('collection/page')->child($page_where);
+            $data['page_id'] = 0;
+            if ($data['page']) {
+                $data['page_id'] = $data['page'][0]['id'];
             }
         }
 
@@ -63,6 +73,7 @@ class Api extends Core
     public function getBuy()
     {
         $id = Dever::input('id');
+        $data['info'] = Dever::db('collection/info')->one($id);
         $where['info_id'] = $id;
         $data['buy'] = Dever::db('collection/buy')->getAll($where);