'待支付', 2 => '待审核', 3 => '待发货', 4 => '待收货确认', 5 => '已完成', 6 => '已完成(有退款)', 7 => '已取消', 8 => '已取消', 11 => '已取消', ); $refund_status = array ( 1 => '未申请', 2 => '已申请', ); $type = Dever::config('base')->source; $search_option_type = Dever::input('search_option_type', 1); return array ( # 表名 'name' => 'buy_order', # 显示给用户看的名称 'lang' => '采购订单', 'order' => 99, 'status' => $status, # 数据结构 'struct' => array ( 'id' => array ( 'type' => 'int-11', 'name' => 'ID', 'default' => '', 'desc' => '', 'match' => 'is_numeric', 'search' => 'order', //'list' => true, ), 'type' => array ( 'type' => 'int-11', 'name' => '采购人类型', 'default' => '', 'desc' => '采购人类型', 'match' => 'is_numeric', ), 'type_id' => array ( 'type' => 'int-11', 'name' => '采购人', 'default' => '', 'desc' => '采购人', 'match' => 'is_numeric', 'list' => 'Dever::load("shop/lib/manage.buyInfo", "{type}", "{type_id}")', ), 'source_type' => array ( 'type' => 'int-11', 'name' => '供货商类型', 'default' => '', 'desc' => '供货商类型', 'match' => 'is_numeric', ), 'source_id' => array ( 'type' => 'int-11', 'name' => '供货商', 'default' => '', 'desc' => '供货商', 'match' => 'is_numeric', 'list' => 'Dever::load("shop/lib/manage.buyInfo", "{source_type}", "{source_id}")', ), 'name' => array ( 'type' => 'varchar-800', 'name' => '订单名称', 'default' => '', 'desc' => '订单名称', 'match' => 'is_string', 'update' => 'text', ), 'parent_order_id' => array ( 'type' => 'varchar-100', 'name' => '原订单编号', 'default' => '', 'desc' => '订单编号', 'match' => 'is_string', ), 'order_num' => array ( 'type' => 'varchar-100', 'name' => '订单编号', 'default' => '', 'desc' => '订单编号', 'match' => 'is_string', 'update' => 'text', 'search' => 'fulltext', 'list' => true, ), 'price' => array ( 'type' => 'varchar-50', 'name' => '购买价格-销售价', 'default' => '0', 'desc' => '购买价格', 'match' => 'option', 'update' => 'text', 'list' => $search_option_type == 1 ? true : false, ), 'p_price' => array ( 'type' => 'varchar-50', 'name' => '购买价格-出厂价,给厂家看的', 'default' => '0', 'desc' => '购买价格', 'match' => 'option', 'update' => 'text', 'list' => $search_option_type == 2 ? true : false, ), 'num' => array ( 'type' => 'int-11', 'name' => '购买数量', 'default' => '', 'desc' => '购买数量', 'match' => 'is_numeric', 'search' => 'select', 'list' => true, ), 'refund_cash' => array ( 'type' => 'varchar-50', 'name' => '退款合计金额-采购价格', 'default' => '0', 'desc' => '退款合计金额', 'match' => 'option', 'update' => 'text', ), 'refund_p_cash' => array ( 'type' => 'varchar-50', 'name' => '退款合计金额-出厂价格', 'default' => '0', 'desc' => '退款合计金额', 'match' => 'option', 'update' => 'text', ), 'refund_status' => array ( 'type' => 'tinyint-1', 'name' => '申请退款类型', 'default' => '1', 'desc' => '申请退款类型', 'match' => 'is_numeric', 'option' => $refund_status, //'search' => 'select', ), 'info' => array ( 'type' => 'varchar-300', 'name' => '订单备注', 'default' => '', 'desc' => '订单备注', 'match' => 'option', 'update' => 'textarea', ), 'status' => array ( 'type' => 'tinyint-1', 'name' => '状态', 'default' => '1', 'desc' => '状态', 'match' => 'is_numeric', 'option' => $status, 'search' => 'select', 'list' => 'Dever::load("mshop/lib/buy.orderStatus", "{id}")', ), 'state' => array ( 'type' => 'tinyint-1', 'name' => '状态', 'default' => '1', 'desc' => '请选择状态', 'match' => 'is_numeric', ), 'fdate' => array ( 'type' => 'int-11', 'name' => '完成时间', 'default' => '', 'match' => 'is_numeric', 'desc' => '', ), 'operdate' => array ( 'type' => 'int-11', 'name' => '审核时间', 'default' => '', 'match' => 'is_numeric', 'desc' => '', ), '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})', //'list' => 'Dever::load("service/lib/manage.showOrderTime", "{id}")', ), ), 'manage' => array ( 'delete' => false, 'edit' => false, 'insert' => false, 'button' => array ( //'导出订单' => array('location', 'user/lib/manage.out'), ), 'list_button' => array( //'edit' => array('退款', 'status,tk_time,tk_pic,tk_desc,tk_admin', '{status} == 2'), //'delete' => array('删除', '', '{status} == 1'), 'list' => array('查看详情', '"buy_order_goods&project=shop&order_id={id}&page_type=1"'), 'oper' => array('审核', '"mshop/lib/manage.audit?order_id={id}"', '{status} == 2'), //'oper1' => array('发货', '"mshop/lib/manage.send?order_id={id}"', '{status} == 3'), //'fast1' => array('发货', '"buy_order_ps&where_id={id}&search_option_order_id={id}&oper_save_jump=buy_order&oper_table=buy_order&oper_parent=buy_order"', '{status} == 3'), ), ), 'request' => array ( 'getAll' => array ( # 匹配的正则或函数 选填项 'option' => array ( 'name' => array('yes', 'like'), 'order_num' => array('yes', 'like'), 'type' => 'yes', 'type_id' => 'yes', 'source_type' => 'yes', 'source_id' => 'yes', 'start' => array('yes-cdate', '>='), 'end' => array('yes-cdate', '<='), 'start_o' => array('yes-operdate', '>='), 'end_o' => array('yes-operdate', '<='), 'start_f' => array('yes-fdate', '>='), 'end_f' => array('yes-fdate', '<='), 'status' => array('yes', 'in'), 'refund_status' => 'yes', 'state' => 1, ), 'type' => 'all', 'order' => array('cdate' => 'desc'), 'page' => array(20, 'list'), 'col' => '*', ), # 获取订单数量 'getOrderNum' => array ( # 匹配的正则或函数 选填项 'option' => array ( 'start' => array('yes-cdate', '>='), 'end' => array('yes-cdate', '<='), 'start_o' => array('yes-operdate', '>='), 'end_o' => array('yes-operdate', '<='), 'type' => 'yes', 'type_id' => 'yes', 'source_type' => 'yes', 'source_id' => 'yes', 'status' => array('yes', 'in'), 'state' => 1, ), 'type' => 'count', 'col' => '*', ), # 获取总金额 'getCashNum' => array ( # 匹配的正则或函数 选填项 'option' => array ( 'start' => array('yes-cdate', '>='), 'end' => array('yes-cdate', '<='), 'start_o' => array('yes-operdate', '>='), 'end_o' => array('yes-operdate', '<='), 'type' => 'yes', 'type_id' => 'yes', 'source_type' => 'yes', 'source_id' => 'yes', 'status' => array('yes', 'in'), 'state' => 1, ), 'type' => 'one', 'col' => 'sum(price-refund_cash) as total', ), # 获取总金额 'getPCashNum' => array ( # 匹配的正则或函数 选填项 'option' => array ( 'start' => array('yes-cdate', '>='), 'end' => array('yes-cdate', '<='), 'start_o' => array('yes-operdate', '>='), 'end_o' => array('yes-operdate', '<='), 'type' => 'yes', 'type_id' => 'yes', 'source_type' => 'yes', 'source_id' => 'yes', 'status' => array('yes', 'in'), 'state' => 1, ), 'type' => 'one', 'col' => 'sum(p_price-refund_p_cash) as total', ), # 获取商品数量 'getGoodsNum' => array ( # 匹配的正则或函数 选填项 'option' => array ( 'start' => array('yes-cdate', '>='), 'end' => array('yes-cdate', '<='), 'start_o' => array('yes-operdate', '>='), 'end_o' => array('yes-operdate', '<='), 'type' => 'yes', 'type_id' => 'yes', 'source_type' => 'yes', 'source_id' => 'yes', 'status' => array('yes', 'in'), 'state' => 1, ), 'type' => 'one', 'col' => 'sum(num) as total', ), ), );