订单状态筛选

pull/1/head
674780036@qq.com 9 months ago
parent e79795b436
commit c922d3fee3
  1. 43
      app/api/model/Order.php

@ -249,25 +249,60 @@ class Order extends OrderModel
switch ($dataType) {
case 'all':
break;
case 'payment':
// case 'payment':
// $filter[] = ['pay_status', '=', PayStatusEnum::PENDING];
// $filter[] = ['order_status', '=', OrderStatusEnum::NORMAL];
// break;
//待付款
case 'pay':
$filter[] = ['pay_status', '=', PayStatusEnum::PENDING];
$filter[] = ['order_status', '=', OrderStatusEnum::NORMAL];
break;
break;
//待发货
case 'delivery':
$filter = [
['pay_status', '=', PayStatusEnum::SUCCESS],
['delivery_status', '<>', DeliveryStatusEnum::DELIVERED],
['order_status', 'in', [OrderStatusEnum::NORMAL, OrderStatusEnum::APPLY_CANCEL]]
];
break;
case 'received':
break;
//待收货
case 'receipt':
$filter = [
['pay_status', '=', PayStatusEnum::SUCCESS],
['delivery_status', '=', DeliveryStatusEnum::DELIVERED],
['receipt_status', '=', ReceiptStatusEnum::NOT_RECEIVED],
['order_status', '=', OrderStatusEnum::NORMAL]
];
break;
//待收货
// case 'received':
// $filter = [
// ['pay_status', '=', PayStatusEnum::SUCCESS],
// ['delivery_status', '=', DeliveryStatusEnum::DELIVERED],
// ['receipt_status', '=', ReceiptStatusEnum::NOT_RECEIVED],
// ['order_status', '=', OrderStatusEnum::NORMAL]
// ];
// break;
//已完成
case 'complete':
$filter = [
['order_status', '=', OrderStatusEnum::COMPLETED]
];
break;
//待取消
case 'apply_cancel':
$filter = [
['order_status', '=', OrderStatusEnum::APPLY_CANCEL]
];
break;
//已取消
case 'cancel':
$filter = [
['order_status', '=', OrderStatusEnum::CANCELLED]
];
break;
//已评价
case 'comment':
$filter = [
['is_comment', '=', 0],

Loading…
Cancel
Save