'启用', 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', ), ) );