'待审', 2 => '已审核', 3 => '未通过', ); return array ( # 表名 'name' => 'in_order_goods', # 显示给用户看的名称 'lang' => '订单商品表', 'menu' => false, 'status' => $status, # 验证供应商商品是否存在 'start' => array ( 'insert' => 'scm_seller/lib/manage.check', ), 'end' => array ( 'insert' => 'scm/lib/order.updateGoods?table=scm_seller/in_order_goods', 'update' => 'scm/lib/order.updateGoods?table=scm_seller/in_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?{supplier_id}', 'bind' => array('onchange', 'loading', array('url' => Dever::url('lib/manage.showInfo?cash_col=buy_price', 'scm_product'), 'col' => 'seller_shop_id,source_type,source_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', ), 'shop_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?cash_col=buy_price', 'scm_product'), 'col' => 'source_type,source_id,seller_shop_id,goods')), ), 'batch' => array ( 'type' => 'varchar-800', 'name' => '入库批次号', 'default' => '', 'desc' => '批次号', 'match' => 'option', 'update' => 'text', 'value' => date('Ymd'), ), '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', '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', '<='), 'seller_id' => array('yes-t_2.seller_id'), 'seller_shop_id' => array('yes-t_2.seller_shop_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_seller/in_order', 'type' => 'left join', 'on' => array('order_id','id'), ), ), 'type' => 'all', 'group' => 't_2.seller_id, t_2.seller_shop_id, t_1.goods_id', 'col' => 'id,t_2.seller_id, t_2.seller_shop_id, t_1.goods_id,sum(t_1.num) as num', ), ), );