123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310 |
- <?php
- $status = array
- (
- 1 => '启用',
- 2 => '不启用',
- );
- return array
- (
- # 表名
- 'name' => 'category',
- # 显示给用户看的名称
- 'lang' => '商品属性分类',
- # 是否显示在后台菜单
- 'order' => 300,
- 'end' => array
- (
- 'insert' => 'scm_product/lib/manage.updateCategory',
- 'update' => 'scm_product/lib/manage.updateCategory',
- ),
- # 数据结构
- 'struct' => array
- (
- 'id' => array
- (
- 'type' => 'int-11',
- 'name' => 'ID',
- 'default' => '',
- 'desc' => '',
- 'match' => 'is_numeric',
- 'list' => true,
- ),
- 'name' => array
- (
- 'type' => 'varchar-150',
- 'name' => '分类名称',
- 'default' => '',
- 'desc' => '分类名称',
- 'match' => 'is_string',
- 'update' => 'text',
- 'search' => 'fulltext',
- 'list' => true,
- 'edit' => true,
- ),
- 'parent' => array
- (
- 'type' => 'varchar-800',
- 'name' => '上级分类',
- 'default' => Dever::input('option_parent', -1),
- 'desc' => '请选择上级分类',
- 'match' => 'option',
- 'update' => 'linkage',
- 'linkage' => 'id=' . Dever::input('where_id'),
- 'option' => Dever::url('lib/category.get', 'scm_product'),
- //'list' => 'Dever::load("scm_product/api.string", "{parent}")',
- ),
- 'parent_id' => array
- (
- 'type' => 'int-11',
- 'name' => '上级分类',
- 'default' => -1,
- 'desc' => '请选择上级分类',
- 'match' => 'option',
- 'value' => Dever::input('option_parent_id', -1),
- //'list' => '{parent_id} > 0 ? Dever::load("scm_product/category-one#name", {parent_id}) : "父级分类"',
- 'list_name' => '属性',
- 'list' => 'Dever::load("scm_product/lib/attr.getInfoByCate", {id})',
- ),
- 'top_parent_id' => array
- (
- 'type' => 'int-11',
- 'name' => '顶级分类',
- 'default' => -1,
- 'desc' => '请选择顶级分类',
- 'match' => 'is_numeric',
- ),
- 'scm_product-category_attr'=> array
- (
- 'name' => '属性设置',
- 'default' => '',
- 'desc' => '请先选择属性分类',
- 'match' => 'option',
- # 同步更新另外一个表的内容,两个表相关联的id,更新另一个表的字段
- 'sync' => array('id', 'category_id'),
- # 根据category字段的值,获取scm_product/attr.search接口的内容
- 'update' => array(1),
- ),
- 'level' => array
- (
- 'type' => 'int-11',
- 'name' => '分类级别-1为顶级分类、2为2级分类,-1为最后一级分类',
- 'default' => 1,
- 'desc' => '分类级别',
- 'match' => 'is_numeric',
- ),
- 'key' => array
- (
- 'type' => 'varchar-150',
- 'name' => '分类标识-该标识一般为前台样式名称,选填项',
- 'default' => '',
- 'desc' => '标识',
- 'match' => 'option',
- 'update' => 'text',
- //'search' => 'fulltext',
- //'list' => true,
- //'edit' => true,
- 'tab' => 1,
- ),
- 'icon' => array
- (
- 'type' => 'varchar-150',
- 'name' => '图标',
- 'default' => '',
- 'desc' => '图标',
- 'match' => 'option',
- 'update' => 'image',
- 'key' => 1,
- 'tab' => 1,
- ),
- 'size' => array
- (
- 'type' => 'varchar-10',
- 'name' => '字体大小-字体px值,为空则使用系统默认字体大小',
- 'default' => '',
- 'desc' => '字体大小',
- 'match' => 'option',
- 'update' => 'text',
- 'tab' => 1,
- ),
- 'color' => array
- (
- 'type' => 'varchar-10',
- 'name' => '字体颜色-请填写颜色代码',
- 'default' => '',
- 'desc' => '字体颜色',
- 'match' => 'option',
- 'update' => 'color',
- 'tab' => 1,
- ),
- 'bgcolor' => array
- (
- 'type' => 'varchar-10',
- 'name' => '背景颜色-请填写颜色代码',
- 'default' => '',
- 'desc' => '背景颜色',
- 'match' => 'option',
- 'update' => 'color',
- 'tab' => 1,
- ),
- 'status' => array
- (
- 'type' => 'tinyint-1',
- 'name' => '是否启用',
- 'default' => '1',
- 'desc' => '是否启用',
- 'match' => 'is_numeric',
- //'update' => 'select',
- 'option' => $status,
- 'list' => true,
- 'edit' => true,
- ),
- 'reorder' => array
- (
- 'type' => 'int-11',
- 'name' => '排序(数值越大越靠前)',
- 'default' => '1',
- 'desc' => '请输入排序',
- 'match' => 'option',
- //'update' => 'text',
- 'search' => 'order',
- 'list_name' => '排序',
- 'list' => true,
- 'order' => 'desc',
- 'edit' => 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
- (
- 'lang' => 'name',
- 'tab' => array('基础设置', '前端样式'),
- # 列表页的类型
- 'list_type' => 'tree',
- 'list_button' => array
- (
- 'add' => array('新增子分类', '"{parent}" == -1 ? "category&option_parent={id}" : "category&option_parent={parent},{id}"'),
- 'list' => array('属性设置', '"category_attr&search_option_category_id={id}&oper_table=category"'),
- ),
- ),
- 'request' => array
- (
- 'getOne' => array
- (
- # 匹配的正则或函数 选填项
- 'option' => array
- (
- 'id' => 'yes',
- 'state' => 1,
- ),
- 'type' => 'one',
- 'col' => 'id,name,parent_id',
- ),
- # 获取顶级分类
- 'getTop' => array
- (
- # 匹配的正则或函数 选填项
- 'option' => array
- (
- 'ids' => array('yes-id', 'in'),
- 'name' => array('yes', 'like'),
- 'id' => 'yes',
- 'parent_id' => -1,
- 'state' => 1,
- ),
- 'type' => 'all',
- 'order' => array('reorder' => 'desc', 'id' => 'asc'),
- 'col' => '*,name as name, id, id as value, "" as selected, "" as disabled|id',
- ),
- 'getChild' => array
- (
- # 匹配的正则或函数 选填项
- 'option' => array
- (
- 'parent_id' => 'yes',
- 'top_parent_id' => 'yes',
- 'level' => 'yes',
- 'parent_id_in' => array('yes-parent_id', 'in'),
- 'id' => array('yes', '!='),
- 'parent' => array('yes', 'like'),
- 'state' => 1,
- ),
- 'type' => 'all',
- 'order' => array('reorder' => 'desc', 'id' => 'asc'),
- 'col' => '*|parent_id|',
- ),
- 'getList' => array
- (
- # 匹配的正则或函数 选填项
- 'option' => array
- (
- 'parent_id' => 'yes',
- 'top_parent_id' => 'yes',
- 'level' => 'yes',
- 'parent_id_in' => array('yes-parent_id', 'in'),
- 'id' => array('yes', '!='),
- 'parent' => array('yes', 'like'),
- 'state' => 1,
- ),
- 'type' => 'all',
- 'order' => array('reorder' => 'desc', 'id' => 'asc'),
- 'col' => '*',
- ),
- 'getAll' => array
- (
- # 匹配的正则或函数 选填项
- 'option' => array
- (
- 'parent_id' => 'yes',
- 'id' => array('yes', '!='),
- 'state' => 1,
- ),
- 'type' => 'all',
- 'order' => array('reorder' => 'desc', 'id' => 'asc'),
- 'col' => 'id as value, name',
- ),
- )
- );
|