|
@@ -1,138 +1,146 @@
|
|
<?php
|
|
<?php
|
|
|
|
|
|
-$col = 'id,info_id,`key`,price,s_price,code';
|
|
|
|
-
|
|
|
|
$config = array
|
|
$config = array
|
|
(
|
|
(
|
|
- # 表名
|
|
|
|
- 'name' => 'info_sku',
|
|
|
|
- # 显示给用户看的名称
|
|
|
|
- 'lang' => '商品规格设置',
|
|
|
|
- 'order' => 200,
|
|
|
|
- 'menu' => false,
|
|
|
|
-
|
|
|
|
- # 数据结构 不同的字段放这里
|
|
|
|
- '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,
|
|
|
|
- ),
|
|
|
|
|
|
+ # 表名
|
|
|
|
+ 'name' => '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,
|
|
|
|
+ ),
|
|
|
|
|
|
- 'key' => array
|
|
|
|
- (
|
|
|
|
- 'type' => 'varchar-100',
|
|
|
|
- 'name' => '规格标识',
|
|
|
|
- 'default' => '-1',
|
|
|
|
- 'desc' => '规格标识',
|
|
|
|
- 'match' => 'is_string',
|
|
|
|
- 'update' => 'text',
|
|
|
|
- ),
|
|
|
|
|
|
+ 'info_id' => array
|
|
|
|
+ (
|
|
|
|
+ 'type' => 'int-11',
|
|
|
|
+ 'name' => '商品ID',
|
|
|
|
+ 'default' => '',
|
|
|
|
+ 'desc' => '商品ID',
|
|
|
|
+ 'match' => 'is_numeric',
|
|
|
|
+ 'update' => 'text',
|
|
|
|
+ 'list' => true,
|
|
|
|
+ ),
|
|
|
|
|
|
- 'attr' => array
|
|
|
|
- (
|
|
|
|
- 'type' => 'text-255',
|
|
|
|
- 'name' => '规格组合规则',
|
|
|
|
- 'default' => '',
|
|
|
|
- 'desc' => '规格组合规则',
|
|
|
|
- 'match' => 'is_string',
|
|
|
|
- 'update' => 'textarea',
|
|
|
|
- 'list' => true,
|
|
|
|
- ),
|
|
|
|
|
|
+ 'key' => array
|
|
|
|
+ (
|
|
|
|
+ 'type' => 'varchar-500',
|
|
|
|
+ 'name' => '规格id',
|
|
|
|
+ 'default' => '',
|
|
|
|
+ 'desc' => '规格id',
|
|
|
|
+ 'match' => 'is_string',
|
|
|
|
+ 'update' => 'text',
|
|
|
|
+ ),
|
|
|
|
|
|
- 'code' => array
|
|
|
|
|
|
+ 'code' => array
|
|
(
|
|
(
|
|
'type' => 'varchar-100',
|
|
'type' => 'varchar-100',
|
|
- 'name' => '商品条码号',
|
|
|
|
|
|
+ 'name' => '商品编码',
|
|
'default' => '',
|
|
'default' => '',
|
|
- 'desc' => '商品条码号',
|
|
|
|
|
|
+ 'desc' => '商品编码',
|
|
'match' => 'is_string',
|
|
'match' => 'is_string',
|
|
'update' => 'text',
|
|
'update' => 'text',
|
|
'search' => 'fulltext',
|
|
'search' => 'fulltext',
|
|
'list' => true,
|
|
'list' => true,
|
|
),
|
|
),
|
|
|
|
|
|
- 'price' => array
|
|
|
|
- (
|
|
|
|
- 'type' => 'decimal-10,2',
|
|
|
|
- 'name' => '售价',
|
|
|
|
- 'default' => '',
|
|
|
|
- 'desc' => '售价',
|
|
|
|
- 'match' => 'is_numeric',
|
|
|
|
- 'update' => 'text',
|
|
|
|
- 'list' => true,
|
|
|
|
- ),
|
|
|
|
|
|
+ 'pic' => array
|
|
|
|
+ (
|
|
|
|
+ 'type' => 'varchar-150',
|
|
|
|
+ 'name' => '商品图',
|
|
|
|
+ 'default' => '',
|
|
|
|
+ 'desc' => '商品图',
|
|
|
|
+ 'match' => 'option',
|
|
|
|
+ 'update' => 'text',
|
|
|
|
+ 'list' => true,
|
|
|
|
+ ),
|
|
|
|
|
|
- 's_price' => array
|
|
|
|
- (
|
|
|
|
- 'type' => 'decimal-10,2',
|
|
|
|
- 'name' => '原价',
|
|
|
|
- 'default' => '',
|
|
|
|
- 'desc' => '原价',
|
|
|
|
- 'match' => 'is_numeric',
|
|
|
|
- 'update' => 'text',
|
|
|
|
- 'list' => true,
|
|
|
|
- ),
|
|
|
|
|
|
+ 'price' => array
|
|
|
|
+ (
|
|
|
|
+ 'type' => 'varchar-100',
|
|
|
|
+ 'name' => '销售价',
|
|
|
|
+ 'default' => '',
|
|
|
|
+ 'desc' => '销售价',
|
|
|
|
+ 'match' => 'option',
|
|
|
|
+ 'update' => 'text',
|
|
|
|
+ 'list' => true,
|
|
|
|
+ ),
|
|
|
|
|
|
- 'reorder' => array
|
|
|
|
- (
|
|
|
|
- 'type' => 'int-11',
|
|
|
|
- 'name' => '排序-数值越大越靠前,相当于置顶',
|
|
|
|
- 'default' => '1',
|
|
|
|
- 'desc' => '请输入排序',
|
|
|
|
- 'match' => 'option',
|
|
|
|
- //'update' => 'text',
|
|
|
|
- 'search' => 'order',
|
|
|
|
- 'list' => true,
|
|
|
|
- 'order' => 'desc',
|
|
|
|
- 'edit' => true,
|
|
|
|
- ),
|
|
|
|
|
|
+ 'buy_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',
|
|
|
|
- ),
|
|
|
|
|
|
+ 'cost_price' => array
|
|
|
|
+ (
|
|
|
|
+ 'type' => 'varchar-100',
|
|
|
|
+ 'name' => '成本价',
|
|
|
|
+ 'default' => '',
|
|
|
|
+ 'desc' => '成本价',
|
|
|
|
+ 'match' => 'option',
|
|
|
|
+ 'update' => 'text',
|
|
|
|
+ //'list' => true,
|
|
|
|
+ ),
|
|
|
|
|
|
- '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})',
|
|
|
|
- ),
|
|
|
|
- ),
|
|
|
|
|
|
+ 'state' => array
|
|
|
|
+ (
|
|
|
|
+ 'type' => 'tinyint-1',
|
|
|
|
+ 'name' => '数据状态',
|
|
|
|
+ 'default' => '1',
|
|
|
|
+ 'desc' => '请选择状态',
|
|
|
|
+ 'match' => 'is_numeric',
|
|
|
|
+ ),
|
|
|
|
|
|
- 'manage' => array
|
|
|
|
|
|
+ '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,
|
|
'insert' => false,
|
|
'edit' => false,
|
|
'edit' => false,
|
|
'delete' => false,
|
|
'delete' => false,
|
|
'num' => false,
|
|
'num' => false,
|
|
- 'page_list_table' => 'sku',
|
|
|
|
|
|
+ //'page_list_table' => 'sku',
|
|
|
|
|
|
# 自定义快捷新增和编辑
|
|
# 自定义快捷新增和编辑
|
|
'button' => array
|
|
'button' => array
|
|
@@ -142,9 +150,9 @@ $config = array
|
|
),
|
|
),
|
|
|
|
|
|
# request 请求接口定义
|
|
# request 请求接口定义
|
|
- 'request' => array
|
|
|
|
- (
|
|
|
|
- # 后台搜索用到 也可以不加,自动生成
|
|
|
|
|
|
+ 'request' => array
|
|
|
|
+ (
|
|
|
|
+ # 后台搜索用到 也可以不加,自动生成
|
|
'search' => array
|
|
'search' => array
|
|
(
|
|
(
|
|
# 匹配的正则或函数 选填项
|
|
# 匹配的正则或函数 选填项
|
|
@@ -156,27 +164,13 @@ $config = array
|
|
'state' => 1,
|
|
'state' => 1,
|
|
),
|
|
),
|
|
'type' => 'all',
|
|
'type' => 'all',
|
|
- 'order' => array('reorder' => 'desc', 'id' => 'desc'),
|
|
|
|
|
|
+ 'order' => array('id' => 'desc'),
|
|
'limit' => '0,10',
|
|
'limit' => '0,10',
|
|
'col' => 'key as name, id, id as value, "" as selected, "" as disabled|id',
|
|
'col' => 'key as name, id, id as value, "" as selected, "" as disabled|id',
|
|
),
|
|
),
|
|
|
|
|
|
# 列表
|
|
# 列表
|
|
- 'getData' => array
|
|
|
|
- (
|
|
|
|
- # 匹配的正则或函数 选填项
|
|
|
|
- 'option' => array
|
|
|
|
- (
|
|
|
|
- 'info_id' => 'yes',
|
|
|
|
- 'state' => 1,
|
|
|
|
- ),
|
|
|
|
- 'type' => 'all',
|
|
|
|
- 'order' => array('id' => 'desc'),
|
|
|
|
- 'col' => $col,
|
|
|
|
- ),
|
|
|
|
-
|
|
|
|
- # 列表
|
|
|
|
- 'getDataByKeys' => array
|
|
|
|
|
|
+ 'getAll' => array
|
|
(
|
|
(
|
|
# 匹配的正则或函数 选填项
|
|
# 匹配的正则或函数 选填项
|
|
'option' => array
|
|
'option' => array
|
|
@@ -186,76 +180,9 @@ $config = array
|
|
),
|
|
),
|
|
'type' => 'all',
|
|
'type' => 'all',
|
|
'order' => array('id' => 'desc'),
|
|
'order' => array('id' => 'desc'),
|
|
- 'col' => $col . '|key',
|
|
|
|
- ),
|
|
|
|
-
|
|
|
|
- # 获取单条数据
|
|
|
|
- 'getOne' => array
|
|
|
|
- (
|
|
|
|
- # 匹配的正则或函数 选填项
|
|
|
|
- 'option' => array
|
|
|
|
- (
|
|
|
|
- 'info_id' => 'yes',
|
|
|
|
- 'state' => 1,
|
|
|
|
- ),
|
|
|
|
- 'type' => 'one',
|
|
|
|
- 'col' => $col,
|
|
|
|
- ),
|
|
|
|
-
|
|
|
|
- 'getMinOne' => array
|
|
|
|
- (
|
|
|
|
- # 匹配的正则或函数 选填项
|
|
|
|
- 'option' => array
|
|
|
|
- (
|
|
|
|
- 'info_id' => 'yes',
|
|
|
|
- 'state' => 1,
|
|
|
|
- ),
|
|
|
|
- 'type' => 'one',
|
|
|
|
- 'order' => array('price' => 'asc', 'id' => 'desc'),
|
|
|
|
- 'col' => $col,
|
|
|
|
|
|
+ 'col' => '*|key',
|
|
),
|
|
),
|
|
-
|
|
|
|
- 'getMaxOne' => array
|
|
|
|
- (
|
|
|
|
- # 匹配的正则或函数 选填项
|
|
|
|
- 'option' => array
|
|
|
|
- (
|
|
|
|
- 'info_id' => 'yes',
|
|
|
|
- 'state' => 1,
|
|
|
|
- ),
|
|
|
|
- 'type' => 'one',
|
|
|
|
- 'order' => array('price' => 'desc', 'id' => 'desc'),
|
|
|
|
- 'col' => $col,
|
|
|
|
- ),
|
|
|
|
-
|
|
|
|
- # 更新售出量
|
|
|
|
- 'updateSell' => array
|
|
|
|
- (
|
|
|
|
- 'type' => 'update',
|
|
|
|
- 'where' => array
|
|
|
|
- (
|
|
|
|
- 'id' => 'yes',
|
|
|
|
- ),
|
|
|
|
- 'set' => array
|
|
|
|
- (
|
|
|
|
- 'sell_num' => array('yes', '+='),
|
|
|
|
- ),
|
|
|
|
- ),
|
|
|
|
-
|
|
|
|
- 'like' => array
|
|
|
|
- (
|
|
|
|
- # 匹配的正则或函数 选填项
|
|
|
|
- 'option' => array
|
|
|
|
- (
|
|
|
|
- 'code' => array('yes', 'like'),
|
|
|
|
- 'id' => 'yes',
|
|
|
|
- 'state' => 1,
|
|
|
|
- ),
|
|
|
|
- 'type' => 'all',
|
|
|
|
- 'order' => array('reorder' => 'desc', 'id' => 'desc'),
|
|
|
|
- 'col' => '*|id',
|
|
|
|
- ),
|
|
|
|
- ),
|
|
|
|
|
|
+ ),
|
|
);
|
|
);
|
|
|
|
|
|
return $config;
|
|
return $config;
|