pay['status']; $method = array ( 1 => '自提', 2 => '外送', ); $pay_method = array ( 1 => '平台结算', 2 => '门店代下单', 3 => '礼品卡', ); $code_status = array ( 1 => '已下单', 2 => '待自提', 3 => '已自提', ); $ps_status = array ( 1 => '已下单', 2 => '待配送', 3 => '配送中', 4 => '已收货', ); $status = array ( 1 => '待支付', 2 => '待处理', 3 => '配送中', 4 => '已完成', 5 => '已取消', 6 => '申请全部退款', 7 => '申请部分退款', 8 => '退货退款', 9 => '部分退款', 10 => '仅退款', 11 => '已过期', ); $tk_status = array ( 1 => '待审核', 2 => '审核通过', 3 => '审核未通过', ); return array ( # 表名 'name' => 'sell_order', # 显示给用户看的名称 'lang' => '销售订单', 'order' => 100, 'status' => $status, 'ps_status' => $ps_status, 'code_status' => $code_status, 'pay_method' => $pay_method, 'method' => $method, # 数据结构 'struct' => array ( 'id' => array ( 'type' => 'int-11', 'name' => 'ID', 'default' => '', 'desc' => '', 'match' => 'is_numeric', 'search' => 'order', //'list' => true, ), 'shop_id' => array ( 'type' => 'int-11', 'name' => '所属门店', 'default' => '', 'desc' => '所属门店', 'match' => 'is_numeric', //'search' => '', 'update' => 'hidden', 'value' => Dever::input('search_option_shop_id'), 'list' => 'Dever::load("shop/info-find#name", {shop_id})', ), 'uid' => array ( 'type' => 'int-11', 'name' => '购买人名称', 'default' => '0', 'desc' => '请选择用户', 'match' => 'is_numeric', 'update' => 'text', //'search' => 'select', 'search' => array ( 'api' => 'passport/user-select', 'col' => 'username', 'result' => 'id', ), 'list' => 'Dever::load("shop/lib/manage.user", {id})', ), 'parent_uid' => array ( 'type' => 'int-11', 'name' => '邀请人', 'default' => '0', 'desc' => '请选择用户', 'match' => 'is_numeric', //'update' => 'text', //'search' => 'select', /* 'search' => array ( 'api' => 'passport/user-all', 'col' => 'username', 'result' => 'id', ), */ //'list_name' => '订单详情', //'list' => 'Dever::load("goods/lib/manage.order", {id})', //'list' => '{parent_uid} > 0 ? Dever::load("passport/user-one#username", {parent_uid}) : "无邀请人"', ), 'mobile' => array ( 'type' => 'varchar-300', 'name' => '下单手机号', 'default' => '', 'desc' => '手机号', 'match' => 'option', 'search' => array ( 'api' => 'passport/user-select',//接口地址,最好是获取多条数据的地址 'col' => 'mobile',//要查询的字段 'result' => 'id',//返回的字段 'search' => 'uid',//本表的字段,默认为当前的字段 ), ), 'address_id' => array ( 'type' => 'int-11', 'name' => '送货地址', 'default' => '', 'desc' => '送货地址', 'match' => 'is_numeric', //'list' => 'Dever::load("passport/address-find#address", {address_id})'; ), 'invoice_id' => array ( 'type' => 'int-11', 'name' => '发票信息', 'default' => '', 'desc' => '发票信息', 'match' => 'is_numeric', //'list' => 'Dever::load("passport/address-find#address", {address_id})'; ), 'name' => array ( 'type' => 'varchar-80', 'name' => '订单名称', 'default' => '', 'desc' => '订单名称', 'match' => 'is_string', 'update' => 'text', ), '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' => '', 'desc' => '付款金额', 'match' => 'option', 'update' => 'text', 'list' => true, ), 'num' => array ( 'type' => 'int-11', 'name' => '购买数量', 'default' => '', 'desc' => '购买数量', 'match' => 'is_numeric', 'search' => 'select', //'list' => true, ), 'card_code_id' => array ( 'type' => 'int-11', 'name' => '礼品卡id', 'default' => '', 'desc' => '礼品卡id', 'match' => 'option', ), 'coupon_id' => array ( 'type' => 'int-11', 'name' => '用户的优惠券id', 'default' => '', 'desc' => '用户的优惠券id', 'match' => 'option', ), 'method' => array ( 'type' => 'int-11', 'name' => '配送类型', 'default' => '1', 'desc' => '配送类型', 'match' => 'is_numeric', 'update' => 'radio', 'option' => $method, ), 'code' => array ( 'type' => 'varchar-100', 'name' => '自提码', 'default' => '', 'desc' => '自提码', 'match' => 'is_numeric', ), 'code_status' => array ( 'type' => 'int-11', 'name' => '自提状态', 'default' => '1', 'desc' => '自提状态', 'match' => 'is_numeric', 'update' => 'radio', 'option' => $code_status, ), 'ps_code' => array ( 'type' => 'varchar-100', 'name' => '物流号', 'default' => '', 'desc' => '物流号', 'match' => 'is_numeric', ), 'ps_status' => array ( 'type' => 'int-11', 'name' => '配送状态', 'default' => '1', 'desc' => '配送状态', 'match' => 'is_numeric', 'update' => 'radio', 'option' => $ps_status, ), 'pay_id' => array ( 'type' => 'varchar-100', 'name' => '支付订单ID', 'default' => '', 'desc' => '付款订单id', 'match' => 'is_string', //'update' => 'text', //'search' => 'fulltext', //'list' => true, ), 'pay_status' => array ( 'type' => 'tinyint-1', 'name' => '支付状态', 'default' => '1', 'desc' => '请选择支付状态', 'match' => 'is_numeric', 'option' => $pay_status, 'list' => true, ), 'pay_price' => array ( 'type' => 'varchar-50', 'name' => '付款金额', 'default' => '', 'desc' => '付款金额', 'match' => 'option', 'update' => 'text', ), 'pay_method' => array ( 'type' => 'int-11', 'name' => '支付类型', 'default' => '1', 'desc' => '支付类型', 'match' => 'is_numeric', 'update' => 'radio', 'option' => $pay_method, 'list' => true, ), 'info' => array ( 'type' => 'varchar-300', 'name' => '订单备注', 'default' => '', 'desc' => '订单备注', 'match' => 'option', 'update' => 'textarea', ), 'note' => array ( 'type' => 'tinyint-1', 'name' => '是否发送状态提醒-1未发送,2已发送', 'default' => '1', 'desc' => '请选择状态', 'match' => 'is_numeric', ), 'notice' => array ( 'type' => 'int-11', 'name' => '模板消息提醒次数', 'default' => '0', 'desc' => '模板消息提醒次数', 'match' => 'is_numeric', ), 'tk_pic' => array ( 'type' => 'varchar-150', 'name' => '退款截图', 'default' => '', 'desc' => '退款截图', 'match' => 'is_string', 'update' => 'image', 'key' => 1 ), 'tk_time' => array ( 'type' => 'int-11', 'name' => '退款时间', 'default' => '', 'desc' => '退款时间', 'match' => 'option', //'list' => true, //'update' => 'date', 'callback' => 'maketime', 'show' => 'status=5', ), 'tk_admin' => array ( 'type' => 'int-11', 'name' => '退款审核人', 'default' => '1', 'desc' => '退款审核人', 'match' => 'option', //'list' => true, 'show' => 'status=5', ), 'tk_desc' => array ( 'type' => 'varchar-300', 'name' => '退款备注', 'default' => '', 'desc' => '退款备注', 'match' => 'option', 'update' => 'textarea', //'show' => 'status=5', ), 'tk_status' => array ( 'type' => 'tinyint-1', 'name' => '申请退款状态', 'default' => '1', 'desc' => '申请退款状态', 'match' => 'option', 'update' => 'radio', 'option' => $tk_status, ), 'area' => array ( 'type' => 'varchar-500', 'name' => '所在地区', 'default' => '', 'desc' => '所在地区', 'match' => 'option', 'search' => 'linkage', 'option' => Dever::url('api.get?level_total=4', 'area'), ), 'province' => array ( 'type' => 'int-11', 'name' => '省份', 'default' => '', 'desc' => '省份', 'match' => 'option', //'update' => 'text', ), 'city' => array ( 'type' => 'int-11', 'name' => '城市', 'default' => '', 'desc' => '城市', 'match' => 'option', //'update' => 'text', ), 'county' => array ( 'type' => 'int-11', 'name' => '县区', 'default' => '', 'desc' => '县区', 'match' => 'option', //'update' => 'text', ), 'town' => array ( 'type' => 'int-11', 'name' => '街道', 'default' => '', 'desc' => '街道', 'match' => 'option', //'update' => 'text', ), 'status' => array ( 'type' => 'tinyint-1', 'name' => '状态', 'default' => '1', 'desc' => '状态', 'match' => 'is_numeric', 'option' => $status, 'search' => 'select', 'list' => 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})', //'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 ( 'fast_list' => array('查看详情', '"sell_order_goods&project=shop&order_id={id}&page_type=1"'), 'edit' => array('退款', 'status,tk_time,tk_pic,tk_desc,tk_admin,tk_status', '{status} == 6'), //'delete' => array('删除', '', '{status} == 1'), ), ), 'request' => array ( 'getList' => array ( # 匹配的正则或函数 选填项 'option' => array ( 'shop_id' => 'yes', 'uid' => 'yes', 'status' => 'yes', 'state' => 1, ), 'type' => 'all', 'order' => array('cdate' => 'desc'), 'page' => array(5, 'list'), 'col' => '*', ), 'getAll' => array ( # 匹配的正则或函数 选填项 'option' => array ( 'uid' => 'yes', 'status' => 'yes', 'state' => 1, ), 'type' => 'all', 'order' => array('cdate' => 'desc'), 'page' => array(10, 'list'), 'col' => '*', ), 'getYes' => array ( # 匹配的正则或函数 选填项 'option' => array ( 'shop_id' => 'yes', 'state' => 1, ), 'type' => 'all', 'order' => array('cdate' => 'desc'), 'col' => '*', ), # 获取提交订单超过12个小时 'getDataByTime' => array ( # 匹配的正则或函数 选填项 'option' => array ( 'cdate' => array('yes', '>='), 'notice' => 'yes', 'note' => 'yes', 'state' => 1, ), 'type' => 'all', 'order' => array('cdate' => 'desc'), 'col' => '*', ), # 获取1,2 'getBuy' => array ( # 匹配的正则或函数 选填项 'option' => array ( 'status' => 'yes', 'shop_id' => 'yes', 'order_num' => 'yes', 'uid' => 'yes', 'state' => 1, ), 'type' => 'all', 'order' => array('id' => 'desc'), 'col' => '*', ), 'getMyAll' => array ( # 匹配的正则或函数 选填项 'option' => array ( 'uid' => 'yes', 'status' => 'yes', 'cate_id' => 'yes', 'state' => 1, ), 'type' => 'all', 'order' => array('id' => 'desc'), 'page' => array(10, 'list'), 'col' => 'id,order_num,name,buy_num,cdate,cash,shop_id,buy_id', ), # 删除未支付订单 'drop' => array ( # 匹配的正则或函数 选填项 'where' => array ( 'time' => array('yes-cdate', '<='), 'status' => 1, 'state' => 1, ), 'type' => 'delete', 'col' => 'id,order_num', ), # 获取数据 'getAllByDate' => array ( # 匹配的正则或函数 选填项 'where' => array ( 'start' => array('yes-cdate', '>='), 'end' => array('yes-cdate', '<='), ), 'type' => 'all', 'col' => 'id,order_num', ), # 获取订单数量 'getOrderNum' => array ( # 匹配的正则或函数 选填项 'option' => array ( 'start' => array('yes-cdate', '>='), 'end' => array('yes-cdate', '<='), 'shop_id' => 'yes', 'status' => array('yes', 'in'), 'state' => 1, ), 'type' => 'count', 'col' => '*', ), # 获取总金额 'getCashNum' => array ( # 匹配的正则或函数 选填项 'option' => array ( 'start' => array('yes-cdate', '>='), 'end' => array('yes-cdate', '<='), 'shop_id' => 'yes', 'status' => array('yes', 'in'), 'state' => 1, ), 'type' => 'one', 'col' => 'sum(price) as total', ), # 获取商品数量 'getGoodsNum' => array ( # 匹配的正则或函数 选填项 'option' => array ( 'start' => array('yes-cdate', '>='), 'end' => array('yes-cdate', '<='), 'shop_id' => 'yes', 'status' => array('yes', 'in'), 'state' => 1, ), 'type' => 'one', 'col' => 'sum(num) as total', ), ), );