123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215 |
- <?php
- $status = array
- (
- 1 => '待审',
- 2 => '已审核',
- 3 => '未通过',
- );
- return array
- (
- # 表名
- 'name' => 'out_order_goods',
- # 显示给用户看的名称
- 'lang' => '订单商品表',
- 'menu' => false,
- 'status' => $status,
- # 验证库存
- 'start' => array
- (
- 'insert' => 'scm/lib/stock.out_check?table=scm_servicer/store_goods&order_table=scm_servicer/out_order&col=servicer_store_id',
- ),
- 'end' => array
- (
- 'insert' => 'scm/lib/order.updateGoods?table=scm_servicer/out_order_goods',
- 'update' => 'scm/lib/order.updateGoods?table=scm_servicer/out_order_goods',
- ),
- # 数据结构
- 'struct' => array
- (
-
- 'id' => array
- (
- 'type' => 'int-11',
- 'name' => 'ID',
- 'default' => '',
- 'desc' => '',
- 'match' => 'is_numeric',
- 'search' => 'order',
- 'update' => 'hidden',
- //'list' => true,
- ),
- 'order_id' => array
- (
- 'type' => 'int-11',
- 'name' => '订单表id',
- 'default' => '',
- 'desc' => '订单表id',
- 'match' => 'is_numeric',
- ),
- 'goods' => array
- (
- 'type' => 'varchar-2000',
- 'name' => '商品',
- 'default' => '',
- 'desc' => '商品',
- 'match' => 'option',
- 'update' => 'select',
- 'update_search' => 'scm_product/lib/manage.searchProduct?{servicer_id,servicer_store_id}',
- 'bind' => array('onchange', 'loading', array('url' => Dever::url('lib/manage.showInfo', 'scm_product'), 'col' => 'servicer_store_id')),
- ),
- 'goods_id' => array
- (
- 'type' => 'int-11',
- 'name' => '库存',
- 'default' => '',
- 'desc' => '商品',
- 'match' => 'is_numeric',
- 'update' => 'show',
- 'value' => '暂无',
- ),
- 'sku_id' => array
- (
- 'type' => 'int-11',
- 'name' => 'sku_id',
- 'default' => '-1',
- 'desc' => 'sku_id',
- 'match' => 'is_numeric',
- ),
- 'store_goods_list_id' => array
- (
- 'type' => 'int-11',
- 'name' => '关联仓库商品id',
- 'default' => '',
- 'desc' => '关联仓库商品id',
- 'match' => 'is_numeric',
- 'value' => '暂无',
- ),
- 'unit_id' => array
- (
- 'type' => 'int-11',
- 'name' => '单位',
- 'default' => '',
- 'desc' => '单位',
- 'match' => 'is_numeric',
- 'update' => 'select',
- 'option' => array(0 => '请先选择商品'),
- 'bind' => array('onchange', 'loading', array('url' => Dever::url('lib/manage.showPriceByUnit', 'scm_product'), 'col' => 'servicer_store_id,goods')),
- ),
- 'batch' => array
- (
- 'type' => 'varchar-800',
- 'name' => '出库批次号',
- 'default' => '',
- 'desc' => '批次号',
- 'match' => 'option',
- 'update' => 'text',
- 'value' => date('Ymd'),
- ),
- 'cash' => array
- (
- 'type' => 'decimal-11,2',
- 'name' => '单价(入库价平均价)',
- 'default' => '',
- 'desc' => '单价',
- 'match' => 'option',
- 'update' => 'text',
- ),
- 'num' => array
- (
- 'type' => 'decimal-11,2',
- 'name' => '数量',
- 'default' => '1',
- 'desc' => '数量',
- 'match' => 'option',
- 'update' => 'text',
- ),
- 'status' => array
- (
- 'type' => 'int-11',
- 'name' => '状态',
- 'default' => '1',
- 'desc' => '状态',
- 'match' => 'is_numeric',
- //'update' => 'select',
- 'option' => $status,
- 'search' => 'select',
- 'list' => true,
- 'edit' => 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})',
- ),
- ),
- 'manage' => array
- (
- 'insert' => false,
- 'delete' => false,
- 'page_list' => 'order_goods',
- ),
- 'request' => array
- (
- 'getNum' => array
- (
- # 匹配的正则或函数 选填项
- 'option' => array
- (
- 'start' => array('yes-t_2.cdate', '>='),
- 'end' => array('yes-t_2.cdate', '<='),
- 'start_o' => array('yes-t_2.operdate', '>='),
- 'end_o' => array('yes-t_2.operdate', '<='),
- 'servicer_id' => array('yes-t_2.servicer_id'),
- 'servicer_store_id' => array('yes-t_2.servicer_store_id'),
- 'goods_id' => array('yes-t_1.goods_id'),
- 'status' => array('yes-t_2.status', 'in'),
- 'state_2' => 'yes-t_2.state-1',
- 'state_1' => 'yes-t_1.state-1',
- 'status_1' => 'yes-t_1.status-1',
- ),
- # 联表
- 'join' => array
- (
- array
- (
- 'table' => 'scm_servicer/out_order',
- 'type' => 'left join',
- 'on' => array('order_id','id'),
- ),
- ),
- 'type' => 'all',
- 'group' => 't_2.servicer_id, t_2.servicer_store_id, t_1.goods_id',
- 'col' => 'id,t_2.servicer_id, t_2.servicer_store_id, t_1.goods_id,sum(t_1.num) as num',
- ),
- ),
- );
|