dever 5 年之前
父节点
当前提交
233777e508
共有 3 个文件被更改,包括 169 次插入3 次删除
  1. 6 2
      app/collection/database/ranking.php
  2. 163 0
      app/collection/database/ranking_data.php
  3. 0 1
      app/community/database/info.php

+ 6 - 2
app/collection/database/ranking.php

@@ -47,7 +47,6 @@ return array
             'match'     => 'is_numeric',
             'search'    => 'order',
             'update'    => 'hidden',
-            'value'     => Dever::input('where_id')
             //'list'        => true,
         ),
 
@@ -172,7 +171,12 @@ return array
 
     'manage' => array
     (
-
+        //'delete' => false,
+        # 列表
+        'list_button' => array
+        (
+            'list' => array('榜单数据', '"ranking_data&search_option_info_id={info_id}&search_option_ranking_id={id}&top_table=ranking_data&oper_table=ranking"'),
+        ),
     ),
 
     'request' => array

+ 163 - 0
app/collection/database/ranking_data.php

@@ -0,0 +1,163 @@
+<?php
+
+$type = array
+(
+    1 => '门票榜单',
+    2 => '购物榜单',
+    3 => '贡献榜单',
+    4 => '积分榜单',
+);
+
+$periods = array
+(
+    1 => '天',
+    2 => '周',
+    3 => '月',
+    4 => '年',
+);
+
+$status = array
+(
+    1 => '开启',
+    2 => '关闭',
+);
+
+return array
+(
+    # 表名
+    'name' => 'ranking_data',
+    # 显示给用户看的名称
+    'lang' => '榜单数据',
+    'menu' => false,
+    # 数据结构
+    'struct' => array
+    (
+    
+        'id'        => array
+        (
+            'type'      => 'int-11',
+            'name'      => 'ID',
+            'default'   => '',
+            'desc'      => '',
+            'match'     => 'is_numeric',
+            'search'    => 'order',
+            'update'    => 'hidden',
+            //'list'        => true,
+        ),
+
+        'info_id'      => array
+        (
+            'type'      => 'int-11',
+            'name'      => '合集',
+            'default'   => '',
+            'desc'      => '合集',
+            'match'     => 'is_numeric',
+            'update'    => 'hidden',
+            'value'     => Dever::input('search_option_info_id')
+        ),
+
+        'ranking_id'      => array
+        (
+            'type'      => 'int-11',
+            'name'      => '榜单id',
+            'default'   => '',
+            'desc'      => '榜单id',
+            'match'     => 'is_numeric',
+            'update'    => 'hidden',
+            'value'     => Dever::input('search_option_ranking_id')
+        ),
+
+        'uid'		=> array
+		(
+			'type' 		=> 'int-11',
+			'name' 		=> '用户名',
+			'default' 	=> '0',
+			'desc' 		=> '请选择用户',
+			'match' 	=> 'is_numeric',
+			'update'	=> 'text',
+			//'search'	=> 'select',
+			'search'    => array
+            (
+                'api' => 'passport/user-all',
+                'col' => 'username',
+                'result' => 'id',
+            ),
+			'list'		=> '{uid} > 0 ? Dever::load("passport/user-one#username", {uid}) : "匿名用户"',
+		),
+
+		'periods'     => array
+        (
+            'type'      => 'int-11',
+            'name'      => '期数',
+            'default'   => '',
+            'desc'      => '期数',
+            'match'     => 'is_numeric',
+            'update'    => 'text',
+            'list'      => true,
+        ),
+
+        'num'     => array
+        (
+            'type'      => 'int-11',
+            'name'      => '榜单数据',
+            'default'   => '0',
+            'desc'      => '榜单数据',
+            'match'     => 'is_numeric',
+            'update'    => 'text',
+            'order'		=> 'desc',
+            'list'      => '{num}{unit}',
+        ),
+
+        'unit'      => array
+        (
+            'type'      => 'varchar-80',
+            'name'      => '单位',
+            'default'   => '',
+            'desc'      => '单位',
+            'match'     => 'is_string',
+            //'update'    => 'text',
+        ),
+
+        'day'     => array
+        (
+            'type'      => 'int-11',
+            'name'      => '日期',
+            'default'   => 'day',
+            'desc'      => '日期',
+            'match'     => 'is_numeric',
+            'list'      => true,
+        ),
+
+        'state'     => array
+        (
+            'type'      => 'tinyint-1',
+            'name'      => '状态',
+            'default'   => '1',
+            'desc'      => '请选择状态',
+            'match'     => 'is_numeric',
+        ),
+        
+        'cdate'     => array
+        (
+            'type'      => 'int-11',
+            'name'      => '创建时间',
+            'match'     => array('is_numeric', time()),
+            'desc'      => '',
+            # 只有insert时才生效
+            'insert'    => true,
+            'search'    => 'date',
+            //'list'      => 'date("Y-m-d H:i:s", {cdate})',
+        ),
+    ),
+
+    'manage' => array
+    (
+    	'edit' => false,
+        'delete' => false,
+    ),
+
+    'request' => array
+    (
+        
+    ),
+);

+ 0 - 1
app/community/database/info.php

@@ -42,7 +42,6 @@ return array
 			//'list'		=> true,
 		),
 		
-
 		'uid'		=> array
 		(
 			'type' 		=> 'int-11',