'info_sku', # 显示给用户看的名称 'lang' => '商品SKU设置', 'order' => 200, 'menu' => false, //'check' => 'code', # 数据结构 不同的字段放这里 'struct' => array ( 'id' => array ( 'type' => 'int-11', 'name' => 'ID', 'default' => '', 'desc' => '', 'match' => 'is_numeric', //'list' => true, ), 'info_id' => array ( 'type' => 'int-11', 'name' => '商品ID', 'default' => '', 'desc' => '商品ID', 'match' => 'is_numeric', 'update' => 'text', 'list' => true, ), 'key' => array ( 'type' => 'varchar-500', 'name' => '规格id', 'default' => '', 'desc' => '规格id', 'match' => 'is_string', 'update' => 'text', ), 'code' => array ( 'type' => 'varchar-100', 'name' => '商品条码', 'default' => '', 'desc' => '商品条码', 'match' => 'is_string', 'update' => 'text', 'search' => 'fulltext', 'list' => true, ), 'pic' => array ( 'type' => 'varchar-150', 'name' => '商品图', 'default' => '', 'desc' => '商品图', 'match' => 'option', 'update' => 'text', 'list' => true, ), 'price' => array ( 'type' => 'varchar-100', 'name' => '销售价', 'default' => '', 'desc' => '销售价', 'match' => 'option', 'update' => 'text', 'list' => true, ), 'un_price' => array ( 'type' => 'varchar-100', 'name' => '划线价', 'default' => '', 'desc' => '划线价', 'match' => 'option', 'update' => 'text', 'list' => true, ), 'buy_price' => array ( 'type' => 'varchar-100', 'name' => '采购价', 'default' => '', 'desc' => '采购价', 'match' => 'option', 'update' => 'text', 'list' => true, ), 'cost_price' => array ( 'type' => 'varchar-100', 'name' => '成本价', 'default' => '', 'desc' => '成本价', 'match' => 'option', 'update' => 'text', //'list' => 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})', ), ), 'index' => array ( 1 => array ( # 索引名 => 索引id 如果有后缀.unique,则为建立索引的类型,如id,state.unique 'info' => 'info_id,`key`', ), # 版本号 更改版本号会更新当前表的索引 'version' => 1, ), 'manage' => array ( 'insert' => false, 'edit' => false, 'delete' => false, 'num' => false, //'page_list_table' => 'sku', # 自定义快捷新增和编辑 'button' => array ( //'自定义属性' => array('fast', 1, 'config&where_id=1'), ), ), # request 请求接口定义 'request' => array ( # 后台搜索用到 也可以不加,自动生成 'search' => array ( # 匹配的正则或函数 选填项 'option' => array ( 'ids' => array('yes-id', 'in'), 'info_id' => 'yes', 'id' => 'yes', 'state' => 1, ), 'type' => 'all', 'order' => array('id' => 'desc'), 'limit' => '0,10', 'col' => 'key as name, id, id as value, "" as selected, "" as disabled|id', ), # 列表 'getAll' => array ( # 匹配的正则或函数 选填项 'option' => array ( 'id' => 'yes', 'info_id' => 'yes', 'state' => 1, ), 'type' => 'all', 'order' => array('id' => 'desc'), 'col' => '*|key', ), # 列表 'getData' => array ( # 匹配的正则或函数 选填项 'option' => array ( 'id' => 'yes', 'info_id' => 'yes', 'state' => 1, ), 'type' => 'all', 'order' => array('id' => 'desc'), 'col' => 'id,`key`,code,pic,price,un_price,buy_price,cost_price|key', ), ), ); return $config;