From b4861ae30e4117365fdbf2646e08fd78bf03997b Mon Sep 17 00:00:00 2001 From: vine_liutk <961510893@qq.com> Date: Fri, 11 Feb 2022 17:45:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=89=B9=E9=9B=B6=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E5=BE=85=E5=8F=91=E8=B4=A7=E9=80=89=E9=A1=B9=E5=8D=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Endpoint/Api/Filters/DealerOrderFilter.php | 5 ++++- app/Models/DealerOrder.php | 12 ++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/app/Endpoint/Api/Filters/DealerOrderFilter.php b/app/Endpoint/Api/Filters/DealerOrderFilter.php index df99b425..b77c5f21 100644 --- a/app/Endpoint/Api/Filters/DealerOrderFilter.php +++ b/app/Endpoint/Api/Filters/DealerOrderFilter.php @@ -18,9 +18,12 @@ class DealerOrderFilter extends ModelFilter case 'wait_paid'://待收款 $this->onlyPaid(); break; - case 'wait_shippinged'://待收货 + case 'wait_shipping'://待发货 $this->onlyShipping(); break; + case 'wait_shippinged'://待收货 + $this->onlyShippinged(); + break; case 'completed'://已完成 $this->onlyCompleted(); break; diff --git a/app/Models/DealerOrder.php b/app/Models/DealerOrder.php index f53485d2..d59eb00c 100644 --- a/app/Models/DealerOrder.php +++ b/app/Models/DealerOrder.php @@ -88,17 +88,25 @@ class DealerOrder extends Model } /** - * 待收款+待发货 + * 待收款 */ public function scopeOnlyPaid($query) { return $query->where('status', DealerOrderStatus::Confirming); } + /** + * 待发货 + */ + public function scopenOnliyShipping($query) + { + return $query->where('status', DealerOrderStatus::Paid); + } + /** * 已发货/待收货 */ - public function scopeOnlyShipping($query) + public function scopeOnlyShippinged($query) { // return $query->whereIn('status', [ // DealerOrderStatus::Confirming, DealerOrderStatus::Paid, DealerOrderStatus::Shipped,