123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603 |
- <?php
- $pay_status = Dever::config('base', 'pay')->pay['status'];
- $method = array
- (
- 1 => '自提',
- 2 => '外送',
- );
- $pay_method = array
- (
- 1 => '平台结算',
- 2 => '门店代下单',
- 3 => '礼品卡',
- );
- $pay_type = array
- (
- 1 => '微信',
- 2 => '现金',
- );
- $status = array
- (
- 1 => '待支付',
- 2 => '待处理',
- 3 => '处理中',
- 4 => '待收货确认',
- 5 => '已完成',
- 6 => '已完成(有退款)',
- 7 => '已取消',
- 8 => '已取消',//已退款
- 11 => '已取消',//已过期
- );
- $status_manage = array
- (
- 1 => '待支付',
- 2 => '待处理',
- 3 => '处理中',
- 4 => '待收货确认',
- 5 => '已完成',
- 6 => '已完成(有退款)',
- 7 => '已取消',
- 8 => '已退款',//已退款
- 11 => '已过期',//已过期
- );
- //1待支付2支付成功3处理中4待确认5已完成6已完成(有退款)7已取消8已退款11已过期
- $refund_status = array
- (
- 1 => '未申请',
- 2 => '已申请',
- );
- $shop = function()
- {
- $array = array();
- $info = Dever::db('shop/info')->select();
- if($info)
- {
- $array += $info;
- }
- return $array;
- };
- return array
- (
- # 表名
- 'name' => 'sell_order',
- # 显示给用户看的名称
- 'lang' => '销售订单',
- 'order' => 100,
- 'status' => $status,
- 'status_manage' => $status_manage,
- 'pay_method' => $pay_method,
- 'pay_type' => $pay_type,
- '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' => 'select',
- 'option' => $shop,
- 'update' => 'hidden',
- 'search' => 'hidden',
- 'value' => Dever::input('search_option_shop_id'),
- 'list' => 'Dever::load("shop/info-one#name", {shop_id})',
- ),
- 'uid' => array
- (
- 'type' => 'int-11',
- 'name' => '购买人名称',
- 'default' => '0',
- 'desc' => '请选择用户',
- 'match' => 'is_numeric',
- 'update' => 'text',
- //'search' => 'select',
- 'search' => array
- (
- 'api' => 'passport/user-one',
- 'col' => 'username',
- 'result' => 'id',
- ),
- 'list' => 'Dever::load("shop/lib/manage.user", {id})',
- ),
- 'mobile' => array
- (
- 'type' => 'varchar-300',
- 'name' => '下单手机号',
- 'default' => '',
- 'desc' => '手机号',
- 'match' => 'option',
- 'search' => 'fulltext',
- /*
- '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-800',
- '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' => '0',
- 'desc' => '支付金额',
- 'match' => 'option',
- 'update' => 'text',
- 'list' => true,
- ),
- '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_status' => array
- (
- 'type' => 'tinyint-1',
- 'name' => '申请退款类型',
- 'default' => '1',
- 'desc' => '申请退款类型',
- 'match' => 'is_numeric',
- 'option' => $refund_status,
- //'search' => 'select',
- ),
- 'kou_cash' => array
- (
- 'type' => 'varchar-50',
- 'name' => '抹零金额',
- 'default' => '0',
- 'desc' => '抹零金额',
- 'match' => 'option',
- 'update' => 'text',
- ),
- 'ps_cash' => array
- (
- 'type' => 'varchar-50',
- 'name' => '配送费',
- 'default' => '0',
- 'desc' => '配送费',
- 'match' => 'option',
- 'update' => 'text',
- ),
- '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',
- ),
- 'user_coupon_id' => array
- (
- 'type' => 'int-11',
- 'name' => '用户的优惠券id',
- 'default' => '',
- 'desc' => '用户的优惠券id',
- 'match' => 'option',
- ),
- 'coupon_cash' => array
- (
- 'type' => 'varchar-300',
- 'name' => '优惠金额',
- 'default' => '0',
- 'desc' => '优惠金额',
- 'match' => 'option',
- 'update' => 'text',
- ),
- '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',
- ),
- 'pay_method' => array
- (
- 'type' => 'int-11',
- 'name' => '支付类型',
- 'default' => '1',
- 'desc' => '支付类型',
- 'match' => 'is_numeric',
- 'update' => 'radio',
- 'option' => $pay_method,
- 'list' => true,
- ),
- 'pay_type' => array
- (
- 'type' => 'int-11',
- 'name' => '支付方式',
- 'default' => '1',
- 'desc' => '支付方式',
- 'match' => 'is_numeric',
- 'update' => 'radio',
- 'option' => $pay_type,
- ),
- '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_manage,
- 'search' => 'select',
- 'list' => true,
- ),
- 'notice' => 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' => '',
- ),
- '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
- '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',
- 'name' => array('yes', 'like'),
- 'shop_id' => 'yes',
- 'mobile' => 'yes',
- 'method' => 'yes',
- 'pay_method' => 'yes',
- 'start' => array('yes-cdate', '>='),
- 'end' => array('yes-cdate', '<='),
- 'status' => array('yes', 'in'),
- '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', '<='),
- 'status' => 'yes',
- 'notice' => '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-refund_cash) 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',
- ),
- ),
- );
|