123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186 |
- <?php
- $config = function()
- {
- $array = array();
- $info = Dever::db('score/config')->state();
- if($info)
- {
- $array += $info;
- }
- return $array;
- };
- $type_id = function()
- {
- $array = array();
- $info = Dever::db('score/level_type')->state();
- if($info)
- {
- $array += $info;
- }
- return $array;
- };
- $total_type = array
- (
- 1 => '限制总数',
- 2 => '不限制',
- );
- return array
- (
- # 表名
- 'name' => 'level',
- # 显示给用户看的名称
- 'lang' => '积分等级设置',
- # 后台菜单排序
- 'order' => 8,
- 'check' => 'level',
- 'desc' => '等级根据积分来升级,积分通过用户行为来生成,如果本项目有多个用户等级,如有声望等级、金币等级、普通用户等级、VIP用户等级,请设置等级类别,否则不需要设置',
- # 数据结构
- 'struct' => array
- (
- 'id' => array
- (
- 'type' => 'int-11',
- 'name' => 'ID',
- 'default' => '',
- 'desc' => '',
- 'match' => 'is_numeric',
- 'search' => 'order',
- //'list' => true,
- //'order' => 'desc',
- ),
-
- 'name' => array
- (
- 'type' => 'varchar-32',
- 'name' => '等级名称',
- 'default' => '',
- 'desc' => '请输入名称',
- 'match' => 'is_string',
- 'update' => 'text',
- 'search' => 'fulltext',
- 'list' => true,
- ),
- 'level_type_id' => array
- (
- 'type' => 'int-11',
- 'name' => '等级类别',
- 'default' => '1',
- 'desc' => '等级类别',
- 'match' => 'is_numeric',
- 'update' => 'select',
- 'option' => $type_id,
- 'search' => 'select',
- 'list' => true,
- ),
-
- 'score' => array
- (
- 'type' => 'text-1000',
- 'name' => '积分设置',
- 'default' => '',
- 'desc' => '积分设置',
- 'match' => 'is_string',
- 'update' => array
- (
- array
- (
- 'col' => 'config',
- 'name' => '积分名称',
- 'default' => '',
- 'desc' => '积分名称',
- 'match' => 'is_string',
- 'update' => 'select',
- 'option' => $config,
- ),
- array
- (
- 'col' => 'num',
- 'name' => '所需积分数',
- 'default' => '0',
- 'desc' => '所需积分数',
- 'match' => 'is_string',
- 'update' => 'text',
- ),
- ),
- ),
- 'level' => array
- (
- 'type' => 'int-11',
- 'name' => '等级数字-请直接输入等级数字,每次升级按照该数字进行匹配,如果设置为1,则为lv1,不允许重复',
- 'default' => '1',
- 'desc' => '等级数字',
- 'match' => 'option',
- 'update' => 'text',
- 'search' => 'order',
- 'list' => true,
- 'order' => 'desc',
- 'edit' => true,
- ),
- 'total_type' => array
- (
- 'type' => 'tinyint-1',
- 'name' => '是否限制当前级别的总数-如果限制,请填写限制的总数,升级的用户数不能超过该数量',
- 'default' => '2',
- 'desc' => '是否限制当前级别的总数',
- 'match' => 'is_numeric',
- 'update' => 'select',
- 'option' => $total_type,
- 'search' => 'select',
- 'control' => 'total_type',
- ),
- 'total' => array
- (
- 'type' => 'int-11',
- 'name' => '限制总数',
- 'default' => '0',
- 'desc' => '限制总数',
- 'match' => 'option',
- 'update' => 'text',
- 'show' => 'total_type=1',
- ),
- '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,
- 'list' => 'date("Y-m-d H:i:s", {cdate})',
- ),
- ),
- 'manage' => array
- (
- # 自定义快捷新增和编辑
- 'button' => array
- (
- '等级类别' => array('list', 'level_type&project=score&oper_parent=level&oper_project=score'),
- ),
- ),
- 'request' => array
- (
-
- ),
- );
|