'store_goods_list', # 显示给用户看的名称 'lang' => '商品价格设置', 'order' => 200, 'menu' => false, # 数据结构 不同的字段放这里 'struct' => array ( 'id' => array ( 'type' => 'int-11', 'name' => 'ID', 'default' => '', 'desc' => '', 'match' => 'is_numeric', //'list' => true, ), 'servicer_store_id' => array ( 'type' => 'int-11', 'name' => '所属配送商', 'default' => '', 'desc' => '所属配送商', 'match' => 'is_numeric', 'update' => 'hidden', 'search' => 'hidden', 'value' => Dever::input('search_option_servicer_store_id'), 'list' => 'Dever::load("scm_servicer/store-one#name", {servicer_store_id})', ), 'store_goods_id' => array ( 'type' => 'int-11', 'name' => '仓库商品id', 'default' => '', 'desc' => '仓库商品id', 'match' => 'is_numeric', ), 'unit_id' => array ( 'type' => 'int-11', 'name' => '单位', 'default' => '', 'desc' => '单位', 'match' => 'is_numeric', //'update' => 'select', ), 'batch' => array ( 'type' => 'varchar-800', 'name' => '入库批次号', 'default' => '', 'desc' => '入库批次号', 'match' => 'option', ), 'sdate' => array ( 'type' => 'int-11', 'name' => '生产日期', 'default' => '', 'desc' => '生产日期', 'match' => 'option', 'update' => 'day', 'callback' => 'maketime', ), 'cash' => array ( 'type' => 'decimal-11,2', 'name' => '入库单价', 'default' => '', 'desc' => '入库单价', 'match' => 'option', ), '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 ( # 列表 先入先出 'getList' => array ( # 匹配的正则或函数 选填项 'option' => array ( 'servicer_store_id' => 'yes', 'goods_id' => 'yes', 'sku_id' => 'yes', 'state' => 1, ), 'type' => 'all', 'order' => array('sdate' => 'asc', 'batch' => 'asc', 'id' => 'asc'), 'col' => '*,in_num-out_num as total', ), # 获取某个sku的单条数据 'getOne' => array ( # 匹配的正则或函数 选填项 'option' => array ( 'servicer_store_id' => 'yes', 'goods_id' => 'yes', 'sku_id' => 'yes', 'state' => 1, ), 'type' => 'one', 'col' => '*,(sum(in_num)-sum(out_num)) as total,AVG(cash) as cash', ), # 获取单位下的数据 'getUnit' => array ( # 匹配的正则或函数 选填项 'option' => array ( 'servicer_store_id' => 'yes', 'goods_id' => 'yes', 'sku_id' => 'yes', 'state' => 1, ), 'type' => 'all', 'group' => 'unit_id', 'col' => '*,(sum(in_num)-sum(out_num)) as total,AVG(cash) as cash|unit_id', ), # 更新入库库存 'inUpdate' => array ( 'type' => 'update', 'where' => array ( 'id' => 'yes', ), 'set' => array ( 'in_num' => array('yes', '+='), ), ), # 更新出库库存 'outUpdate' => array ( 'type' => 'update', 'where' => array ( 'id' => 'yes', ), 'set' => array ( 'out_num' => array('yes', '+='), ), ), # 更新入库在途库存 'onInUpdate' => array ( 'type' => 'update', 'where' => array ( 'id' => 'yes', ), 'set' => array ( 'on_in_num' => array('yes', '+='), ), ), # 更新出库在途库存 'onOutUpdate' => array ( 'type' => 'update', 'where' => array ( 'id' => 'yes', ), 'set' => array ( 'on_out_num' => array('yes', '+='), ), ), ), ); return $config;