|
@@ -1,24 +1,18 @@
|
|
<?php
|
|
<?php
|
|
|
|
|
|
-$config = array
|
|
|
|
|
|
+return array
|
|
(
|
|
(
|
|
# 表名
|
|
# 表名
|
|
- 'name' => 'goods_sku',
|
|
|
|
|
|
+ 'name' => 'shop_goods',
|
|
# 显示给用户看的名称
|
|
# 显示给用户看的名称
|
|
- 'lang' => '商品价格设置',
|
|
|
|
- 'order' => 200,
|
|
|
|
- 'menu' => false,
|
|
|
|
- /*
|
|
|
|
- 'end' => array
|
|
|
|
- (
|
|
|
|
- 'insert' => 'scm_role/lib/seller.skuUpdate',
|
|
|
|
- 'update' => 'scm_role/lib/seller.skuUpdate',
|
|
|
|
- ),
|
|
|
|
- */
|
|
|
|
|
|
+ 'lang' => '门店商品列表',
|
|
|
|
+ 'order' => 10,
|
|
|
|
+ 'menu' => false,
|
|
|
|
|
|
- # 数据结构 不同的字段放这里
|
|
|
|
|
|
+ # 数据结构
|
|
'struct' => array
|
|
'struct' => array
|
|
(
|
|
(
|
|
|
|
+
|
|
'id' => array
|
|
'id' => array
|
|
(
|
|
(
|
|
'type' => 'int-11',
|
|
'type' => 'int-11',
|
|
@@ -26,23 +20,25 @@ $config = array
|
|
'default' => '',
|
|
'default' => '',
|
|
'desc' => '',
|
|
'desc' => '',
|
|
'match' => 'is_numeric',
|
|
'match' => 'is_numeric',
|
|
|
|
+ 'search' => 'order',
|
|
|
|
+ 'update' => 'hidden',
|
|
//'list' => true,
|
|
//'list' => true,
|
|
),
|
|
),
|
|
|
|
|
|
- 'seller_id' => array
|
|
|
|
|
|
+ 'seller_shop_id' => array
|
|
(
|
|
(
|
|
'type' => 'int-11',
|
|
'type' => 'int-11',
|
|
- 'name' => '所属销售商',
|
|
|
|
|
|
+ 'name' => '经销商门店',
|
|
'default' => '',
|
|
'default' => '',
|
|
- 'desc' => '所属销售商',
|
|
|
|
|
|
+ 'desc' => '经销商门店',
|
|
'match' => 'is_numeric',
|
|
'match' => 'is_numeric',
|
|
'update' => 'hidden',
|
|
'update' => 'hidden',
|
|
'search' => 'hidden',
|
|
'search' => 'hidden',
|
|
- 'value' => Dever::input('search_option_seller_id'),
|
|
|
|
- 'list' => 'Dever::load("scm_seller/info-one#name", {seller_id})',
|
|
|
|
|
|
+ 'value' => Dever::input('search_option_seller_shop_id'),
|
|
|
|
+ 'list' => 'Dever::load("scm_seller/shop-one#name", {seller_shop_id})',
|
|
),
|
|
),
|
|
|
|
|
|
- 'goods-info_sku-code'=> array
|
|
|
|
|
|
+ 'scm_product-info_sku-code'=> array
|
|
(
|
|
(
|
|
'name' => '商品编码',
|
|
'name' => '商品编码',
|
|
'default' => '',
|
|
'default' => '',
|
|
@@ -50,8 +46,14 @@ $config = array
|
|
'match' => 'option',
|
|
'match' => 'option',
|
|
# 读取另外表的关联方式
|
|
# 读取另外表的关联方式
|
|
'sync' => array('sku_id', 'id', 'goods_id', 'info_id', 'key'),
|
|
'sync' => array('sku_id', 'id', 'goods_id', 'info_id', 'key'),
|
|
|
|
+ 'search' => array
|
|
|
|
+ (
|
|
|
|
+ 'api' => 'scm_product/info_sku-all',
|
|
|
|
+ 'col' => 'code',
|
|
|
|
+ 'result' => 'id',
|
|
|
|
+ 'search' => 'sku_id',
|
|
|
|
+ ),
|
|
'list' => true,
|
|
'list' => true,
|
|
- 'list_order' => 4,
|
|
|
|
),
|
|
),
|
|
|
|
|
|
'goods_id' => array
|
|
'goods_id' => array
|
|
@@ -61,9 +63,16 @@ $config = array
|
|
'default' => '',
|
|
'default' => '',
|
|
'desc' => '商品名称',
|
|
'desc' => '商品名称',
|
|
'match' => 'is_numeric',
|
|
'match' => 'is_numeric',
|
|
|
|
+ 'search' => array
|
|
|
|
+ (
|
|
|
|
+ 'api' => 'scm_product/info-all',
|
|
|
|
+ 'col' => 'name',
|
|
|
|
+ 'result' => 'id',
|
|
|
|
+ 'search' => 'goods_id',
|
|
|
|
+ ),
|
|
'update' => 'select',
|
|
'update' => 'select',
|
|
'update_search' => 'scm_product/lib/manage.search',
|
|
'update_search' => 'scm_product/lib/manage.search',
|
|
- 'list' => 'Dever::load("scm_product/info-one#name", {goods_id})',
|
|
|
|
|
|
+ 'list' => 'Dever::load("scm_product/lib/info.getBaseInfo#aname", "{goods_id}", "{sku_id}")',
|
|
),
|
|
),
|
|
|
|
|
|
'sku_id' => array
|
|
'sku_id' => array
|
|
@@ -75,54 +84,65 @@ $config = array
|
|
'match' => 'is_numeric',
|
|
'match' => 'is_numeric',
|
|
),
|
|
),
|
|
|
|
|
|
|
|
+ 'unit_id' => array
|
|
|
|
+ (
|
|
|
|
+ 'type' => 'int-11',
|
|
|
|
+ 'name' => '基本单位',
|
|
|
|
+ 'default' => '',
|
|
|
|
+ 'desc' => '基本单位',
|
|
|
|
+ 'match' => 'is_numeric',
|
|
|
|
+ 'list' => 'Dever::load("scm/unit-one#name", {unit_id})',
|
|
|
|
+ ),
|
|
|
|
+
|
|
|
|
+ 'cash' => array
|
|
|
|
+ (
|
|
|
|
+ 'type' => 'decimal-11,2',
|
|
|
|
+ 'name' => '入库均价',
|
|
|
|
+ 'default' => '',
|
|
|
|
+ 'desc' => '入库均价',
|
|
|
|
+ 'match' => 'option',
|
|
|
|
+ 'list' => true,
|
|
|
|
+ ),
|
|
|
|
+
|
|
'in_num' => array
|
|
'in_num' => array
|
|
(
|
|
(
|
|
'type' => 'decimal-11,2',
|
|
'type' => 'decimal-11,2',
|
|
- 'name' => '入库库存',
|
|
|
|
|
|
+ 'name' => '入库总库存',
|
|
'default' => '0',
|
|
'default' => '0',
|
|
- 'desc' => '入库库存',
|
|
|
|
|
|
+ 'desc' => '入库总库存',
|
|
'match' => 'is_numeric',
|
|
'match' => 'is_numeric',
|
|
|
|
+ 'list' => true,
|
|
),
|
|
),
|
|
|
|
|
|
'out_num' => array
|
|
'out_num' => array
|
|
(
|
|
(
|
|
'type' => 'decimal-11,2',
|
|
'type' => 'decimal-11,2',
|
|
- 'name' => '出库库存',
|
|
|
|
|
|
+ 'name' => '出库总库存',
|
|
'default' => '0',
|
|
'default' => '0',
|
|
- 'desc' => '出库库存',
|
|
|
|
|
|
+ 'desc' => '出库总库存',
|
|
'match' => 'option',
|
|
'match' => 'option',
|
|
- ),
|
|
|
|
-
|
|
|
|
- 'min' => array
|
|
|
|
- (
|
|
|
|
- 'type' => 'float-11,2',
|
|
|
|
- 'name' => '起购数',
|
|
|
|
- 'default' => '1',
|
|
|
|
- 'desc' => '起购数',
|
|
|
|
- 'match' => 'is_string',
|
|
|
|
- 'update' => 'text',
|
|
|
|
- //'list' => true,
|
|
|
|
|
|
+ 'list' => true,
|
|
),
|
|
),
|
|
|
|
|
|
'state' => array
|
|
'state' => array
|
|
(
|
|
(
|
|
'type' => 'tinyint-1',
|
|
'type' => 'tinyint-1',
|
|
- 'name' => '数据状态',
|
|
|
|
|
|
+ 'name' => '状态',
|
|
'default' => '1',
|
|
'default' => '1',
|
|
'desc' => '请选择状态',
|
|
'desc' => '请选择状态',
|
|
'match' => 'is_numeric',
|
|
'match' => 'is_numeric',
|
|
),
|
|
),
|
|
-
|
|
|
|
|
|
+
|
|
'cdate' => array
|
|
'cdate' => array
|
|
(
|
|
(
|
|
'type' => 'int-11',
|
|
'type' => 'int-11',
|
|
- 'name' => '发布时间',
|
|
|
|
|
|
+ 'name' => '创建时间',
|
|
'match' => array('is_numeric', time()),
|
|
'match' => array('is_numeric', time()),
|
|
'desc' => '',
|
|
'desc' => '',
|
|
# 只有insert时才生效
|
|
# 只有insert时才生效
|
|
'insert' => true,
|
|
'insert' => true,
|
|
- //'search' => 'date',
|
|
|
|
- //'list' => 'date("Y-m-d H:i:s", {cdate})',
|
|
|
|
|
|
+ //'search' => 'date',
|
|
|
|
+ //'list' => 'date("Y-m-d H:i:s", {cdate})',
|
|
),
|
|
),
|
|
),
|
|
),
|
|
|
|
|
|
@@ -131,28 +151,25 @@ $config = array
|
|
'insert' => false,
|
|
'insert' => false,
|
|
'edit' => false,
|
|
'edit' => false,
|
|
'delete' => false,
|
|
'delete' => false,
|
|
- //'excel' => array(array('导出门店库存', '门店库存', '')),
|
|
|
|
- 'page_list_table' => 'sku',
|
|
|
|
|
|
+ 'list_button' => array
|
|
|
|
+ (
|
|
|
|
+ 'list' => array('查看详情', '"shop_goods_list&oper_table=shop_goods&top_table=info&search_option_shop_goods_id={id}"'),
|
|
|
|
+ ),
|
|
),
|
|
),
|
|
|
|
|
|
- # request 请求接口定义
|
|
|
|
'request' => array
|
|
'request' => array
|
|
(
|
|
(
|
|
- 'getDataPage' => array
|
|
|
|
|
|
+ # 后台搜索用到,也可以不加,自动生成
|
|
|
|
+ 'search' => array
|
|
(
|
|
(
|
|
# 匹配的正则或函数 选填项
|
|
# 匹配的正则或函数 选填项
|
|
'option' => array
|
|
'option' => array
|
|
(
|
|
(
|
|
- 'seller_id' => array('yes-t_1.seller_id'),
|
|
|
|
'name' => array('yes-t_2.name', 'like'),
|
|
'name' => array('yes-t_2.name', 'like'),
|
|
- 'total' => array('yes|t_1.in_num-t_1.out_num', '<'),
|
|
|
|
- 'category' => array('yes-t_2.category', 'like'),
|
|
|
|
- 'top_category_id' => array('yes-t_2.top_category_id'),
|
|
|
|
- 'second_category_id' => array('yes-t_2.second_category_id'),
|
|
|
|
- 'category_id' => array('yes-t_2.category_id'),
|
|
|
|
- 'status' => array('yes-t_2.status', 1),
|
|
|
|
- 'state' => array('yes-t_2.state', 1),
|
|
|
|
- 'state_1' => array('yes-t_1.state', 1),
|
|
|
|
|
|
+ 'seller_shop_id' => array('yes-t_1.seller_shop_id'),
|
|
|
|
+ 'status' => 'yes-t_2.status-1',
|
|
|
|
+ 'state' => 'yes-t_2.state-1',
|
|
|
|
+ 'state_1' => 'yes-t_1.state-1',
|
|
),
|
|
),
|
|
# 联表
|
|
# 联表
|
|
'join' => array
|
|
'join' => array
|
|
@@ -167,8 +184,8 @@ $config = array
|
|
),
|
|
),
|
|
'type' => 'all',
|
|
'type' => 'all',
|
|
'order' => array('t_2.reorder' => 'desc', 't_2.id' => 'desc'),
|
|
'order' => array('t_2.reorder' => 'desc', 't_2.id' => 'desc'),
|
|
- 'page' => array(30, 'list'),
|
|
|
|
- 'col' => '*,t_2.name,t_2.pic,t_2.video,t_2.id as id,t_1.in_num-t_1.out_num as total,t_1.out_num',
|
|
|
|
|
|
+ 'page' => array(10, 'list'),
|
|
|
|
+ 'col' => '*, t_2.*,t_2.id as value, "" as selected, "" as disabled',
|
|
),
|
|
),
|
|
|
|
|
|
'getData' => array
|
|
'getData' => array
|
|
@@ -176,16 +193,16 @@ $config = array
|
|
# 匹配的正则或函数 选填项
|
|
# 匹配的正则或函数 选填项
|
|
'option' => array
|
|
'option' => array
|
|
(
|
|
(
|
|
- 'seller_id' => array('yes-t_1.seller_id'),
|
|
|
|
|
|
+ 'seller_shop_id' => array('yes-t_1.seller_shop_id'),
|
|
|
|
+ 'sell_type' => array('yes-t_2.sell_type'),
|
|
'name' => array('yes-t_2.name', 'like'),
|
|
'name' => array('yes-t_2.name', 'like'),
|
|
- 'total' => array('yes|t_1.in_num-t_1.out_num', '<'),
|
|
|
|
'category' => array('yes-t_2.category', 'like'),
|
|
'category' => array('yes-t_2.category', 'like'),
|
|
'top_category_id' => array('yes-t_2.top_category_id'),
|
|
'top_category_id' => array('yes-t_2.top_category_id'),
|
|
'second_category_id' => array('yes-t_2.second_category_id'),
|
|
'second_category_id' => array('yes-t_2.second_category_id'),
|
|
'category_id' => array('yes-t_2.category_id'),
|
|
'category_id' => array('yes-t_2.category_id'),
|
|
- 'status' => array('yes-t_2.status', 1),
|
|
|
|
- 'state' => array('yes-t_2.state', 1),
|
|
|
|
- 'state_1' => array('yes-t_1.state', 1),
|
|
|
|
|
|
+ 'status' => 'yes-t_2.status-1',
|
|
|
|
+ 'state' => 'yes-t_2.state-1',
|
|
|
|
+ 'state_1' => 'yes-t_1.state-1',
|
|
),
|
|
),
|
|
# 联表
|
|
# 联表
|
|
'join' => array
|
|
'join' => array
|
|
@@ -200,118 +217,70 @@ $config = array
|
|
),
|
|
),
|
|
'type' => 'all',
|
|
'type' => 'all',
|
|
'order' => array('t_2.reorder' => 'desc', 't_2.id' => 'desc'),
|
|
'order' => array('t_2.reorder' => 'desc', 't_2.id' => 'desc'),
|
|
- 'col' => '*,t_2.name,t_2.pic,t_2.video,t_2.id as id,t_1.in_num-t_1.out_num as total,t_1.out_num,t_1.in_num,t_2.type,t_2.stock,t_2.commission,t_2.sell_type,t_2.buy_type',
|
|
|
|
|
|
+ 'col' => 'id,name,category,pic,content,video,type,unit,spec_type,goods,commission,pay_money,money_id,score_id,sell_type,buy_type,udate,cdate',
|
|
),
|
|
),
|
|
|
|
|
|
- # 列表
|
|
|
|
- 'getList' => array
|
|
|
|
|
|
+ 'getDataPage' => array
|
|
(
|
|
(
|
|
# 匹配的正则或函数 选填项
|
|
# 匹配的正则或函数 选填项
|
|
'option' => array
|
|
'option' => array
|
|
(
|
|
(
|
|
- 'seller_id' => 'yes',
|
|
|
|
- 'goods_id' => 'yes',
|
|
|
|
- 'sku_id' => 'yes',
|
|
|
|
- 'state' => 1,
|
|
|
|
|
|
+ 'seller_shop_id' => array('yes-t_1.seller_shop_id'),
|
|
|
|
+ 'sell_type' => array('yes-t_2.sell_type'),
|
|
|
|
+ 'name' => array('yes-t_2.name', 'like'),
|
|
|
|
+ 'category' => array('yes-t_2.category', 'like'),
|
|
|
|
+ 'top_category_id' => array('yes-t_2.top_category_id'),
|
|
|
|
+ 'second_category_id' => array('yes-t_2.second_category_id'),
|
|
|
|
+ 'category_id' => array('yes-t_2.category_id'),
|
|
|
|
+ 'status' => 'yes-t_2.status-1',
|
|
|
|
+ 'state' => 'yes-t_2.state-1',
|
|
|
|
+ 'state_1' => 'yes-t_1.state-1',
|
|
|
|
+ ),
|
|
|
|
+ # 联表
|
|
|
|
+ 'join' => array
|
|
|
|
+ (
|
|
|
|
+ array
|
|
|
|
+ (
|
|
|
|
+ 'table' => 'scm_product/info',
|
|
|
|
+ 'type' => 'left join',
|
|
|
|
+ 'on' => array('goods_id','id'),
|
|
|
|
+ 'col' => 'goods_id',
|
|
|
|
+ ),
|
|
),
|
|
),
|
|
'type' => 'all',
|
|
'type' => 'all',
|
|
- 'order' => array('id' => 'desc'),
|
|
|
|
- 'col' => '*,in_num-out_num as total|sku_id',
|
|
|
|
|
|
+ 'order' => array('t_2.reorder' => 'desc', 't_2.id' => 'desc'),
|
|
|
|
+ 'page' => array(10, 'list'),
|
|
|
|
+ 'col' => 'id,name,category,pic,content,video,type,unit,spec_type,goods,commission,pay_money,money_id,score_id,sell_type,buy_type,udate,t_1.cdate,t_1.id as id',
|
|
),
|
|
),
|
|
|
|
|
|
- # 获取单条数据
|
|
|
|
|
|
+ # 获取某个sku的单条数据
|
|
'getOne' => array
|
|
'getOne' => array
|
|
(
|
|
(
|
|
# 匹配的正则或函数 选填项
|
|
# 匹配的正则或函数 选填项
|
|
'option' => array
|
|
'option' => array
|
|
(
|
|
(
|
|
- 'seller_id' => 'yes',
|
|
|
|
|
|
+ 'seller_shop_id' => 'yes',
|
|
'goods_id' => 'yes',
|
|
'goods_id' => 'yes',
|
|
'sku_id' => 'yes',
|
|
'sku_id' => 'yes',
|
|
'state' => 1,
|
|
'state' => 1,
|
|
),
|
|
),
|
|
'type' => 'one',
|
|
'type' => 'one',
|
|
- 'col' => '*,in_num-out_num as total',
|
|
|
|
- ),
|
|
|
|
-
|
|
|
|
- # 更新售出量
|
|
|
|
- 'incSell' => array
|
|
|
|
- (
|
|
|
|
- 'type' => 'update',
|
|
|
|
- 'where' => array
|
|
|
|
- (
|
|
|
|
- 'seller_id' => 'yes',
|
|
|
|
- 'goods_id' => 'yes',
|
|
|
|
- 'sku_id' => 'yes',
|
|
|
|
- ),
|
|
|
|
- 'set' => array
|
|
|
|
- (
|
|
|
|
- 'out_num' => array('yes', '+='),
|
|
|
|
- ),
|
|
|
|
- ),
|
|
|
|
-
|
|
|
|
- # 减少售出量
|
|
|
|
- 'decSell' => array
|
|
|
|
- (
|
|
|
|
- 'type' => 'update',
|
|
|
|
- 'where' => array
|
|
|
|
- (
|
|
|
|
- 'seller_id' => 'yes',
|
|
|
|
- 'goods_id' => 'yes',
|
|
|
|
- 'sku_id' => 'yes',
|
|
|
|
- ),
|
|
|
|
- 'set' => array
|
|
|
|
- (
|
|
|
|
- 'out_num' => array('yes', '-='),
|
|
|
|
- ),
|
|
|
|
- ),
|
|
|
|
-
|
|
|
|
- # 更新总库存
|
|
|
|
- 'updateTotal' => array
|
|
|
|
- (
|
|
|
|
- 'type' => 'update',
|
|
|
|
- 'where' => array
|
|
|
|
- (
|
|
|
|
- 'id' => 'yes',
|
|
|
|
- ),
|
|
|
|
- 'set' => array
|
|
|
|
- (
|
|
|
|
- 'in_num' => array('yes', '+='),
|
|
|
|
- ),
|
|
|
|
- ),
|
|
|
|
-
|
|
|
|
- # 增加总库存
|
|
|
|
- 'incTotal' => array
|
|
|
|
- (
|
|
|
|
- 'type' => 'update',
|
|
|
|
- 'where' => array
|
|
|
|
- (
|
|
|
|
- 'seller_id' => 'yes',
|
|
|
|
- 'goods_id' => 'yes',
|
|
|
|
- 'sku_id' => 'yes',
|
|
|
|
- ),
|
|
|
|
- 'set' => array
|
|
|
|
- (
|
|
|
|
- 'in_num' => array('yes', '+='),
|
|
|
|
- ),
|
|
|
|
|
|
+ 'col' => '*,(sum(in_num)-sum(out_num)) as total,AVG(cash) as cash',
|
|
),
|
|
),
|
|
|
|
|
|
- # 减少总库存
|
|
|
|
- 'decTotal' => array
|
|
|
|
|
|
+ # 获取单位下的数据
|
|
|
|
+ 'getUnit' => array
|
|
(
|
|
(
|
|
- 'type' => 'update',
|
|
|
|
- 'where' => array
|
|
|
|
|
|
+ # 匹配的正则或函数 选填项
|
|
|
|
+ 'option' => array
|
|
(
|
|
(
|
|
- 'seller_id' => 'yes',
|
|
|
|
|
|
+ 'seller_shop_id' => 'yes',
|
|
'goods_id' => 'yes',
|
|
'goods_id' => 'yes',
|
|
'sku_id' => 'yes',
|
|
'sku_id' => 'yes',
|
|
|
|
+ 'state' => 1,
|
|
),
|
|
),
|
|
- 'set' => array
|
|
|
|
- (
|
|
|
|
- 'in_num' => array('yes', '-='),
|
|
|
|
- ),
|
|
|
|
|
|
+ 'type' => 'all',
|
|
|
|
+ 'col' => '*,(in_num-out_num) as total|unit_id',
|
|
),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
);
|
|
-
|
|
|
|
-return $config;
|
|
|