'数字输入框', 2 => '单行输入框', 3 => '多行输入框', //4 => '图文编辑器', 5 => '单图片上传', 6 => '多图片上传', 7 => '地区选择器', //8 => '多级分类', 9 => '区间输入框', 10 => '单选框', 11 => '多选框', 12 => '单项选择框', ); $is_must = array ( 1 => '必填项', 2 => '选填项', ); $data_type = array ( 1 => '数字', 2 => '字符', 3 => '正则匹配', ); /* 使用该组件,这么用 $attr = function() { $auth = Dever::load('attr/api.get', false); return $auth; }; 'attr' => array ( 'type' => 'varchar-800', 'name' => '属性设置', 'default' => '', 'desc' => '属性设置', 'match' => 'option', 'update' => 'checkbox', 'option' => $attr, 'update_input' => '', 'update_input_default' => '', 'update_parent' => 'checkbox', ), 'attr_input' => array ( 'type' => 'text-255', 'name' => '属性值设置', 'default' => '', 'desc' => '属性值设置', 'match' => 'option', ), */ return array ( # 表名 'name' => 'category_attr', # 显示给用户看的名称 'lang' => '属性设置', # 是否显示在后台菜单 'order' => 10, 'menu' => false, 'end' => array ( 'insert' => 'product/lib/manage.updateAttr', 'update' => 'product/lib/manage.updateAttr', ), # 数据结构 'struct' => array ( 'id' => array ( 'type' => 'int-11', 'name' => 'ID', 'default' => '', 'desc' => '', 'match' => 'is_numeric', 'order' => 'asc', 'list' => true, ), 'name' => array ( 'type' => 'varchar-150', 'name' => '名称', 'default' => '', 'desc' => '名称', 'match' => 'is_string', 'update' => 'text', 'search' => 'fulltext', 'list' => true, 'edit' => true, 'tab' => 0, ), 'category_id' => array ( 'type' => 'int-11', 'name' => '分类', 'default' => '-1', 'desc' => '分类', 'match' => 'is_numeric', 'update' => 'hidden', 'value' => Dever::input('search_option_category_id'), //'list' => '{category_id} > 0 ? Dever::load("product/category-one#name", {category_id}) : "未选择"', 'tab' => 0, ), 'is_must' => array ( 'type' => 'tinyint-1', 'name' => '是否必填', 'default' => '1', 'desc' => '是否必填', 'match' => 'is_numeric', 'update' => 'radio', 'option' => $is_must, 'search' => 'select', 'list' => true, 'tab' => 0, ), 'type' => array ( 'type' => 'tinyint-11', 'name' => '录入类型-配置录入类型后可以在商品录入时进行属性设置', 'default' => '1', 'desc' => '录入类型', 'match' => 'is_numeric', 'update' => 'radio', 'option' => $type, //'search' => 'select', //'list' => true, 'control' => 'type', 'tab' => 0, ), 'data_type' => array ( 'type' => 'tinyint-1', 'name' => '数据验证类型-选择类型之后会自动验证数据有效性', 'default' => '1', 'desc' => '数据验证类型', 'match' => 'is_numeric', 'update' => 'radio', 'option' => $data_type, 'search' => 'select', //'list' => true, 'control' => 'data_type', 'show' => 'type=2', 'tab' => 0, ), 'match' => array ( 'type' => 'varchar-600', 'name' => '正则匹配规则-直接输入正则表达式即可', 'default' => '', 'desc' => '正则匹配规则', 'match' => 'option', 'update' => 'textarea', //'search' => 'fulltext', //'list' => true, //'edit' => true, 'show' => array('data_type' => 3), 'tab' => 0, ), 'list_reorder' => array ( 'type' => 'int-11', 'name' => '列表页排序-设置该属性在列表页中的排序,数字越大越靠前,如果为负数或者0,则不加入到列表页中。', 'default' => '1', 'desc' => '是否作为搜索条件', 'match' => 'is_numeric', 'update' => 'text', 'show' => 'type=1,2,7,9,10,11,12', //'search' => 'order', //'order' => 'desc', 'edit' => true, //'list' => true, 'tab' => 2, ), 'search_reorder' => array ( 'type' => 'int-11', 'name' => '搜索条件排序-设置搜索条件中的排序,数字越大越靠前,如果为负数或者0,则不加入到搜索条件中。', 'default' => '1', 'desc' => '是否作为搜索条件', 'match' => 'is_numeric', 'update' => 'text', 'show' => 'type=1,2,7,9,10,11,12', //'search' => 'order', //'order' => 'desc', 'edit' => true, //'list' => true, 'tab' => 2, ), 'view_reorder' => array ( 'type' => 'int-11', 'name' => '详情页排序-设置该属性在详情页中的排序,数字越大越靠前,如果为负数或者0,则不加入到详情页中。', 'default' => '1', 'desc' => '详情页排序', 'match' => 'is_numeric', 'update' => 'text', //'show' => 'type=1,2,7,9,10,11,12', //'search' => 'order', //'order' => 'desc', 'edit' => true, //'list' => true, 'tab' => 2, ), 'key' => array ( 'type' => 'varchar-150', 'name' => '标识-该标识一般为前台样式名称,选填项', 'default' => '', 'desc' => '标识', 'match' => 'option', 'update' => 'text', //'search' => 'fulltext', //'list' => true, //'edit' => true, 'tab' => 1, ), 'unit' => array ( 'type' => 'varchar-150', 'name' => '单位-填写属性单位,选填项', 'default' => '', 'desc' => '单位', 'match' => 'option', 'update' => 'text', 'tab' => 1, ), 'icon' => array ( 'type' => 'varchar-150', 'name' => '图标-属性图标,选填项', 'default' => '', 'desc' => '图标', 'match' => 'option', 'update' => 'image', 'key' => 1, '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, ), '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,unit', 'tab' => array('基本配置', '扩展设置', '排序规则'), 'insert' => false, 'edit' => false, 'button' => array ( '新增' => array('fast'), ), # 列表 'list_button' => array ( 'fast' => array('编辑'), 'list1' => array('属性值设置', '"category_attr_value&search_type=4&search_option_category_id={category_id}&search_option_attr_id={id}&oper_table=category_attr&top_table=category"' , '{type} > 9'), 'list2' => array('搜索值设置', '"category_attr_search&search_type=4&search_option_attr_id={id}&search_option_category_id={category_id}&oper_table=category_attr&top_table=category"' , '{type} == 1 || {type} == 9'), ), ), 'request' => array ( 'getOne' => array ( # 匹配的正则或函数 选填项 'option' => array ( 'id' => 'yes', 'state' => 1, ), 'type' => 'one', 'col' => 'id,type,unit,name,icon as front_icon,color as front_color,bgcolor as front_bgcolor', ), 'getAll' => array ( # 匹配的正则或函数 选填项 'option' => array ( 'ids' => array('yes-id', 'in'), //'state' => 1, ), 'type' => 'all', 'order' => array('list_reorder`+`search_reorder`+`view_reorder' => 'desc', 'id' => 'desc'), 'col' => $col. '|id', ), 'getAllByIds' => array ( # 匹配的正则或函数 选填项 'option' => array ( 'ids' => array('yes-id', 'in'), //'state' => 1, ), 'type' => 'all', 'order' => array('list_reorder`+`search_reorder`+`view_reorder' => 'desc', 'id' => 'desc'), 'col' => $col. '|id', ), 'getListByIds' => array ( # 匹配的正则或函数 选填项 'option' => array ( 'ids' => array('yes-id', 'in'), 'list_reorder' => array('yes', '>='), 'state' => 1, ), 'type' => 'all', 'order' => array('list_reorder' => 'desc', 'id' => 'desc'), 'col' => $col. '|id', ), 'getSearchByIds' => array ( # 匹配的正则或函数 选填项 'option' => array ( 'ids' => array('yes-id', 'in'), 'search_reorder' => array('yes', '>='), 'state' => 1, ), 'type' => 'all', 'order' => array('search_reorder' => 'desc', 'id' => 'desc'), 'col' => $col. '|id', ), 'getViewByIds' => array ( # 匹配的正则或函数 选填项 'option' => array ( 'ids' => array('yes-id', 'in'), 'view_reorder' => array('yes', '>='), 'state' => 1, ), 'type' => 'all', 'order' => array('view_reorder' => 'desc', 'id' => 'desc'), 'col' => $col. '|id', ), 'getCateAll' => array ( # 匹配的正则或函数 选填项 'option' => array ( 'category_id' => array('yes', 'in'), 'state' => 1, ), 'type' => 'all', 'order' => array('list_reorder`+`search_reorder`+`view_reorder' => 'desc', 'id' => 'desc'), 'col' => '*', ), /* 'getSearch' => array ( # 匹配的正则或函数 选填项 'option' => array ( 'ids' => array('yes-id', 'in'), 'search_reorder' => array('yes', '>='), 'state' => 1, ), 'type' => 'all', 'order' => array('search_reorder' => 'desc', 'id' => 'desc'), 'col' => '*', ), */ ) );