|
@@ -1,345 +0,0 @@
|
|
|
-<?php
|
|
|
-
|
|
|
-$config = array
|
|
|
-(
|
|
|
- # 表名
|
|
|
- 'name' => 'goods_sku',
|
|
|
- # 显示给用户看的名称
|
|
|
- 'lang' => '商品价格设置',
|
|
|
- 'order' => 200,
|
|
|
- 'menu' => false,
|
|
|
- /*
|
|
|
- 'end' => array
|
|
|
- (
|
|
|
- 'insert' => 'scm_role/lib/seller.skuUpdate',
|
|
|
- 'update' => 'scm_role/lib/seller.skuUpdate',
|
|
|
- ),
|
|
|
- */
|
|
|
-
|
|
|
- # 数据结构 不同的字段放这里
|
|
|
- 'struct' => array
|
|
|
- (
|
|
|
- 'id' => array
|
|
|
- (
|
|
|
- 'type' => 'int-11',
|
|
|
- 'name' => 'ID',
|
|
|
- 'default' => '',
|
|
|
- 'desc' => '',
|
|
|
- 'match' => 'is_numeric',
|
|
|
- //'list' => true,
|
|
|
- ),
|
|
|
-
|
|
|
- 'supplier_id' => array
|
|
|
- (
|
|
|
- 'type' => 'int-11',
|
|
|
- 'name' => '所属供应商',
|
|
|
- 'default' => '',
|
|
|
- 'desc' => '所属供应商',
|
|
|
- 'match' => 'is_numeric',
|
|
|
- 'update' => 'hidden',
|
|
|
- 'search' => 'hidden',
|
|
|
- 'value' => Dever::input('search_option_supplier_id'),
|
|
|
- 'list' => 'Dever::load("scm_supplier/info-one#name", {supplier_id})',
|
|
|
- ),
|
|
|
-
|
|
|
- 'goods-info_sku-code'=> array
|
|
|
- (
|
|
|
- 'name' => '商品编码',
|
|
|
- 'default' => '',
|
|
|
- 'desc' => '商品编码',
|
|
|
- 'match' => 'option',
|
|
|
- # 读取另外表的关联方式
|
|
|
- 'sync' => array('sku_id', 'id', 'goods_id', 'info_id', 'key'),
|
|
|
- 'list' => true,
|
|
|
- 'list_order' => 4,
|
|
|
- ),
|
|
|
-
|
|
|
- 'goods_id' => array
|
|
|
- (
|
|
|
- 'type' => 'int-11',
|
|
|
- 'name' => '商品名称',
|
|
|
- 'default' => '',
|
|
|
- 'desc' => '商品名称',
|
|
|
- 'match' => 'is_numeric',
|
|
|
- 'update' => 'select',
|
|
|
- 'update_search' => 'scm_product/lib/manage.search',
|
|
|
- 'list' => 'Dever::load("scm_product/info-one#name", {goods_id})',
|
|
|
- ),
|
|
|
-
|
|
|
- 'sku_id' => array
|
|
|
- (
|
|
|
- 'type' => 'int-11',
|
|
|
- 'name' => '规格型号',
|
|
|
- 'default' => '-1',
|
|
|
- 'desc' => '规格型号',
|
|
|
- 'match' => 'is_numeric',
|
|
|
- ),
|
|
|
-
|
|
|
- 'cost_price' => array
|
|
|
- (
|
|
|
- 'type' => 'varchar-100',
|
|
|
- 'name' => '成本价',
|
|
|
- 'default' => '',
|
|
|
- 'desc' => '成本价',
|
|
|
- 'match' => 'option',
|
|
|
- 'update' => 'text',
|
|
|
- //'list' => true,
|
|
|
- ),
|
|
|
-
|
|
|
- 'in_num' => array
|
|
|
- (
|
|
|
- 'type' => 'decimal-11,2',
|
|
|
- 'name' => '入库库存',
|
|
|
- 'default' => '0',
|
|
|
- 'desc' => '入库库存',
|
|
|
- 'match' => 'is_numeric',
|
|
|
- ),
|
|
|
-
|
|
|
- 'out_num' => array
|
|
|
- (
|
|
|
- 'type' => 'decimal-11,2',
|
|
|
- 'name' => '出库库存',
|
|
|
- 'default' => '0',
|
|
|
- 'desc' => '出库库存',
|
|
|
- 'match' => 'option',
|
|
|
- ),
|
|
|
-
|
|
|
- '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
|
|
|
- (
|
|
|
- 'insert' => false,
|
|
|
- 'edit' => false,
|
|
|
- 'delete' => false,
|
|
|
- //'excel' => array(array('导出门店库存', '门店库存', '')),
|
|
|
- 'page_list_table' => 'sku',
|
|
|
- ),
|
|
|
-
|
|
|
- # request 请求接口定义
|
|
|
- 'request' => array
|
|
|
- (
|
|
|
- # 后台搜索用到,也可以不加,自动生成
|
|
|
- 'search' => array
|
|
|
- (
|
|
|
- # 匹配的正则或函数 选填项
|
|
|
- 'option' => array
|
|
|
- (
|
|
|
- 'name' => array('yes-t_2.name', 'like'),
|
|
|
- 'supplier_id' => array('yes-t_1.supplier_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',
|
|
|
- 'order' => array('t_2.reorder' => 'desc', 't_2.id' => 'desc'),
|
|
|
- 'col' => '*,t_2.*,t_2.id as value, "" as selected, "" as disabled',
|
|
|
- ),
|
|
|
-
|
|
|
- 'getDataPage' => array
|
|
|
- (
|
|
|
- # 匹配的正则或函数 选填项
|
|
|
- 'option' => array
|
|
|
- (
|
|
|
- 'supplier_id' => array('yes-t_1.supplier_id'),
|
|
|
- '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),
|
|
|
- ),
|
|
|
- # 联表
|
|
|
- 'join' => array
|
|
|
- (
|
|
|
- array
|
|
|
- (
|
|
|
- 'table' => 'scm_product/info',
|
|
|
- 'type' => 'left join',
|
|
|
- 'on' => array('goods_id','id'),
|
|
|
- 'col' => 'goods_id',
|
|
|
- ),
|
|
|
- ),
|
|
|
- 'type' => 'all',
|
|
|
- 'order' => array('t_2.reorder' => 'desc', 't_2.id' => 'desc', 't_2.price' => 'asc'),
|
|
|
- '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',
|
|
|
- ),
|
|
|
-
|
|
|
- 'getData' => array
|
|
|
- (
|
|
|
- # 匹配的正则或函数 选填项
|
|
|
- 'option' => array
|
|
|
- (
|
|
|
- 'supplier_id' => array('yes-t_1.supplier_id'),
|
|
|
- '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),
|
|
|
- ),
|
|
|
- # 联表
|
|
|
- 'join' => array
|
|
|
- (
|
|
|
- array
|
|
|
- (
|
|
|
- 'table' => 'scm_product/info',
|
|
|
- 'type' => 'left join',
|
|
|
- 'on' => array('goods_id','id'),
|
|
|
- 'col' => 'goods_id',
|
|
|
- ),
|
|
|
- ),
|
|
|
- 'type' => 'all',
|
|
|
- 'order' => array('t_2.reorder' => 'desc', 't_2.id' => 'desc', 't_2.price' => 'asc'),
|
|
|
- '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',
|
|
|
- ),
|
|
|
-
|
|
|
- # 列表
|
|
|
- 'getList' => array
|
|
|
- (
|
|
|
- # 匹配的正则或函数 选填项
|
|
|
- 'option' => array
|
|
|
- (
|
|
|
- 'supplier_id' => 'yes',
|
|
|
- 'goods_id' => 'yes',
|
|
|
- 'sku_id' => 'yes',
|
|
|
- 'state' => 1,
|
|
|
- ),
|
|
|
- 'type' => 'all',
|
|
|
- 'order' => array('id' => 'desc'),
|
|
|
- 'col' => '*,in_num-out_num as total|sku_id',
|
|
|
- ),
|
|
|
-
|
|
|
- # 获取单条数据
|
|
|
- 'getOne' => array
|
|
|
- (
|
|
|
- # 匹配的正则或函数 选填项
|
|
|
- 'option' => array
|
|
|
- (
|
|
|
- 'supplier_id' => 'yes',
|
|
|
- 'goods_id' => 'yes',
|
|
|
- 'sku_id' => 'yes',
|
|
|
- 'state' => 1,
|
|
|
- ),
|
|
|
- 'type' => 'one',
|
|
|
- 'col' => '*,in_num-out_num as total',
|
|
|
- ),
|
|
|
-
|
|
|
- # 更新售出量
|
|
|
- 'incSell' => array
|
|
|
- (
|
|
|
- 'type' => 'update',
|
|
|
- 'where' => array
|
|
|
- (
|
|
|
- 'supplier_id' => 'yes',
|
|
|
- 'goods_id' => 'yes',
|
|
|
- 'sku_id' => 'yes',
|
|
|
- ),
|
|
|
- 'set' => array
|
|
|
- (
|
|
|
- 'out_num' => array('yes', '+='),
|
|
|
- ),
|
|
|
- ),
|
|
|
-
|
|
|
- # 减少售出量
|
|
|
- 'decSell' => array
|
|
|
- (
|
|
|
- 'type' => 'update',
|
|
|
- 'where' => array
|
|
|
- (
|
|
|
- 'supplier_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
|
|
|
- (
|
|
|
- 'supplier_id' => 'yes',
|
|
|
- 'goods_id' => 'yes',
|
|
|
- 'sku_id' => 'yes',
|
|
|
- ),
|
|
|
- 'set' => array
|
|
|
- (
|
|
|
- 'in_num' => array('yes', '+='),
|
|
|
- ),
|
|
|
- ),
|
|
|
-
|
|
|
- # 减少总库存
|
|
|
- 'decTotal' => array
|
|
|
- (
|
|
|
- 'type' => 'update',
|
|
|
- 'where' => array
|
|
|
- (
|
|
|
- 'supplier_id' => 'yes',
|
|
|
- 'goods_id' => 'yes',
|
|
|
- 'sku_id' => 'yes',
|
|
|
- ),
|
|
|
- 'set' => array
|
|
|
- (
|
|
|
- 'in_num' => array('yes', '-='),
|
|
|
- ),
|
|
|
- ),
|
|
|
- ),
|
|
|
-);
|
|
|
-
|
|
|
-return $config;
|