123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517 |
- <?php
- $cate = function()
- {
- $array = array();
- $info = Dever::load('attr/cate-state');
- if($info)
- {
- $array += $info;
- }
- return $array;
- };
- $col = 'id,name,is_must,is_sell,sell_type,sell_compute,sell_value,`type`,data_type,`match`,`unit`,ename,icon,color,bgcolor,list_reorder,search_reorder,view_reorder,cate_id,state';
- $type = array
- (
- 1 => '数字输入框',
- 2 => '单行输入框',
- 3 => '多行输入框',
- //4 => '图文编辑器',
- 5 => '单图片上传',
- 6 => '多图片上传',
- 7 => '地区选择器',
- //8 => '多级分类',
- 9 => '区间输入框',
- 10 => '单选框',
- 11 => '多选框',
- 12 => '单项选择框',
- );
- $is_must = array
- (
- 1 => '必填项',
- 2 => '选填项',
- );
- $is_sell = array
- (
- 1 => '普通属性',
- 2 => '销售属性',
- );
- $sell_type = array
- (
- 1 => '组合',
- 2 => '单选',
- 3 => '输入',
- );
- $sell_compute = array
- (
- 1 => '相乘',
- 2 => '相加',
- 3 => '相减',
- );
- $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' => 'info',
- # 显示给用户看的名称
- 'lang' => '属性设置',
- # 是否显示在后台菜单
- 'order' => 10,
- 'sell_type' => $sell_type,
- 'sell_compute' => $sell_compute,
- 'end' => array
- (
- 'insert' => 'attr/lib/manage.infoUpdate',
- 'update' => 'attr/lib/manage.infoUpdate',
- ),
- # 数据结构
- 'struct' => array
- (
- 'id' => array
- (
- 'type' => 'int-11',
- 'name' => 'ID',
- 'default' => '',
- 'desc' => '',
- 'match' => 'is_numeric',
- 'order' => 'asc',
- 'list' => true,
- ),
- 'hr1' => array
- (
- 'name' => '基本配置',
- 'class' => '',//本项必须填写
- 'attr' => '',
- ),
- 'name' => array
- (
- 'type' => 'varchar-150',
- 'name' => '名称',
- 'default' => '',
- 'desc' => '名称',
- 'match' => 'is_string',
- 'update' => 'text',
- 'search' => 'fulltext',
- 'list' => true,
- 'edit' => true,
- ),
- 'cate_id' => array
- (
- 'type' => 'int-11',
- 'name' => '属性类别-可以通过类别将属性进行分类',
- 'default' => '1',
- 'desc' => '属性类别',
- 'match' => 'is_numeric',
- 'update' => 'select',
- 'search' => 'select',
- 'option' => $cate,
- //'list' => '{cate_id} > 0 ? Dever::load("attr/cate-one#name", {cate_id}) : "未选择"',
- ),
- 'is_must' => array
- (
- 'type' => 'tinyint-1',
- 'name' => '是否必填',
- 'default' => '1',
- 'desc' => '是否必填',
- 'match' => 'is_numeric',
- 'update' => 'radio',
- 'option' => $is_must,
- 'search' => 'select',
- 'list' => true,
- //'edit' => true,
- ),
- 'is_sell' => array
- (
- 'type' => 'tinyint-1',
- 'name' => '是否销售属性-销售属性将可以配置价格,一般用于商品',
- 'default' => '1',
- 'desc' => '属性类型',
- 'match' => 'is_numeric',
- 'update' => 'radio',
- 'option' => $is_sell,
- 'search' => 'select',
- 'list' => true,
- //'edit' => true,
- 'control' => 'is_sell',
- ),
- 'sell_type' => array
- (
- 'type' => 'tinyint-1',
- 'name' => '销售属性类型-组合类型将会生成不同的SKU组合价格,根据不同的SKU组合生成总价和库存;单选类型将生成单独的属性价格,将影响总价,可单独设置库存;输入类型一般为输入尺寸,需要单独设置影响总价的方式;具体价格都需要在商品中设置',
- 'default' => '1',
- 'desc' => '销售属性类型',
- 'match' => 'is_numeric',
- 'update' => 'radio',
- 'option' => $sell_type,
- //'search' => 'select',
- 'show' => 'is_sell=2',
- 'control' => 'sell_type',
- ),
- 'sell_compute' => array
- (
- 'type' => 'tinyint-1',
- 'name' => '计算方式-如输入类型设置了宽度和高度,总价需要平米来计算,这里选择相乘即可',
- 'default' => '1',
- 'desc' => '销售属性类型',
- 'match' => 'is_numeric',
- 'update' => 'radio',
- 'option' => $sell_compute,
- //'search' => 'select',
- 'show' => 'sell_type=3',
- ),
- 'sell_value' => array
- (
- 'type' => 'varchar-50',
- 'name' => '价格起始值-同样是平米为例,这里输入10的话,就是大于10平米时开始加价,具体加价多少需要在商品中设置',
- 'default' => '0',
- 'desc' => '价格起始值',
- 'match' => 'is_string',
- 'update' => 'text',
- 'show' => 'sell_type=3',
- ),
- 'type' => array
- (
- 'type' => 'tinyint-11',
- 'name' => '后台录入类型-配置录入类型后可以在后台商品管理中的属性设置进行设置',
- 'default' => '1',
- 'desc' => '后台录入类型',
- 'match' => 'is_numeric',
- 'update' => 'radio',
- 'option' => $type,
- //'search' => 'select',
- //'list' => true,
- 'show' => 'is_sell=1',
- 'control' => 'type',
- ),
- /*
- 'type_option' => array
- (
- 'type' => 'varchar-800',
- 'name' => '属性可选项-多个值用换行隔开,如果是数字或区间输入框,这里定义的是搜索时的选项,比如单价如果需要搜索,可以设置为"100万以下,{v}<=100",半角逗号之后的为表达式,{v}为当前值,如果是区间输入框,则{s}为区间最小值,{e}为区间最大值,如"100万以下,{e}<=100"。',
- 'default' => '',
- 'desc' => '属性可选项',
- 'match' => 'is_string',
- 'update' => 'textarea',
- //'list' => true,
- 'show' => 'type=1,9,10,11,12',
- ),
- */
- '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',
- ),
- 'match' => array
- (
- 'type' => 'varchar-600',
- 'name' => '正则匹配规则-直接输入正则表达式即可',
- 'default' => '',
- 'desc' => '正则匹配规则',
- 'match' => 'option',
- 'update' => 'textarea',
- //'search' => 'fulltext',
- //'list' => true,
- //'edit' => true,
- 'show' => array('data_type' => 3),
- ),
- 'hr2' => array
- (
- 'name' => '排序规则',
- 'class' => '',//本项必须填写
- 'attr' => '',
- ),
- '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,
- ),
- '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,
- ),
- '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,
- ),
- 'hr3' => array
- (
- 'name' => '扩展设置',
- 'class' => '',//本项必须填写
- 'attr' => '',
- ),
- 'unit' => array
- (
- 'type' => 'varchar-150',
- 'name' => '单位-填写属性单位,选填项',
- 'default' => '',
- 'desc' => '单位',
- 'match' => 'option',
- 'update' => 'text',
- ),
- 'ename' => array
- (
- 'type' => 'varchar-150',
- 'name' => '英文标识-该标识一般为前台样式名称,选填项',
- 'default' => '',
- 'desc' => '英文名称',
- 'match' => 'option',
- 'update' => 'text',
- //'search' => 'fulltext',
- //'list' => true,
- //'edit' => true,
- ),
- 'icon' => array
- (
- 'type' => 'varchar-150',
- 'name' => '图标-属性图标,选填项',
- 'default' => '',
- 'desc' => '图标',
- 'match' => 'option',
- 'update' => 'image',
- 'key' => 1,
- ),
- 'color' => array
- (
- 'type' => 'varchar-10',
- 'name' => '字体颜色-请填写颜色代码,选填项',
- 'default' => '',
- 'desc' => '字体颜色',
- 'match' => 'option',
- 'update' => 'color',
- ),
- 'bgcolor' => array
- (
- 'type' => 'varchar-10',
- 'name' => '背景颜色-请填写颜色代码,选填项',
- 'default' => '',
- 'desc' => '背景颜色',
- 'match' => 'option',
- 'update' => 'color',
- ),
-
- '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
- (
- # 列表
- 'list_button' => array
- (
- 'list1' => array('属性值设置', '"value&project=attr&search_type=4&search_option_info_id={id}&oper_table=info&oper_project=attr"' , '{type} > 9'),
- 'list2' => array('搜索值设置', '"search&project=attr&search_type=4&search_option_info_id={id}&oper_table=info&oper_project=attr"' , '{type} == 1 || {type} == 9'),
- ),
- ),
- 'request' => array
- (
- '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',
- ),
- /*
- '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' => '*',
- ),
- */
- )
- );
|