123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119 |
- <?php
- /*
- |--------------------------------------------------------------------------
- | attr.php 分类属性关联表
- |--------------------------------------------------------------------------
- */
- $menu = false;
- if (Dever::project('attr')) {
- $menu = 'category';
- }
- $attr = function()
- {
- $auth = Dever::load('attr/api.get', false);
- return $auth;
- };
- return array
- (
- # 表名
- 'name' => 'attr',
- # 显示给用户看的名称
- 'lang' => '分类属性设置',
- 'order' => 100,
- 'menu' => $menu,
- 'check' => 'category',
- # 数据结构
- 'struct' => array
- (
- 'id' => array
- (
- 'type' => 'int-11',
- 'name' => 'ID',
- 'default' => '',
- 'desc' => '',
- 'match' => 'is_numeric',
- 'search' => 'order',
- //'list' => true,
- ),
- 'category' => array
- (
- 'type' => 'varchar-500',
- 'name' => '分类',
- 'default' => '',
- 'desc' => '该分类下已有属性设置',
- 'match' => 'is_string',
- //'search' => 'linkage',
- 'update' => 'linkage',
- 'option' => Dever::url('api.get', 'category'),
- 'list' => 'Dever::load("category/api.string", "{category}")',
- ),
-
- 'attr' => array
- (
- 'type' => 'varchar-800',
- 'name' => '属性设置',
- 'default' => '',
- 'desc' => '属性设置',
- 'match' => 'option',
- 'update' => 'checkbox',
- 'option' => $attr,
- //'update_input' => '',
- //'update_input_default' => '',
- 'update_parent' => 'checkbox',
- 'list' => 'Dever::load("attr/api.string", "{attr}", "{attr_input}")',
- ),
- 'attr_input' => array
- (
- 'type' => 'text-255',
- 'name' => '属性值设置',
- 'default' => '',
- 'desc' => '属性值设置',
- 'match' => 'option',
- ),
- 'state' => array
- (
- 'type' => 'tinyint-1',
- 'name' => '状态',
- 'default' => '1',
- 'desc' => '请选择状态',
- 'match' => 'is_numeric',
- ),
-
- 'cdate' => array
- (
- 'type' => 'int-11',
- 'name' => '录入时间',
- 'match' => array('is_numeric', DEVER_TIME),
- 'desc' => '',
- # 只有insert时才生效
- 'insert' => true,
- 'list' => 'date("Y-m-d H:i:s", {cdate})',
- ),
- ),
- 'manage' => array
- (
- //'delete' => false,
- //'edit' => false,
- //'insert' => false,
- ),
- 'request' => array
- (
- 'getAttr' => array
- (
- # 匹配的正则或函数 选填项
- 'option' => array
- (
- 'category' => array('yes', 'like'),
- ),
- 'type' => 'all',
- 'order' => array('id' => 'desc'),
- 'col' => 'attr,attr_input',
- ),
- )
- );
|