From 385cf0d936ec9192e85804ab2783ef58afb9b48e Mon Sep 17 00:00:00 2001 From: vine_liutk <961510893@qq.com> Date: Mon, 13 Dec 2021 11:23:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=96=E6=B6=88=E8=AE=A1=E7=AE=97=E8=BF=90?= =?UTF-8?q?=E8=B4=B9=E8=B0=83=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Admin/Controllers/HomeController.php | 4 ---- app/Services/ShippingService.php | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/app/Admin/Controllers/HomeController.php b/app/Admin/Controllers/HomeController.php index 922e1481..6f9d71c9 100644 --- a/app/Admin/Controllers/HomeController.php +++ b/app/Admin/Controllers/HomeController.php @@ -3,16 +3,12 @@ namespace App\Admin\Controllers; use App\Http\Controllers\Controller; -use App\Services\ShippingService; use Dcat\Admin\Layout\Content; class HomeController extends Controller { public function index(Content $content) { - $shippingService = new ShippingService(); - $amount = $shippingService->countShippingAmount(3560, 2000, 1, 2225); - dd($amount); return $content ->header('Dashboard') ->description('Description...'); diff --git a/app/Services/ShippingService.php b/app/Services/ShippingService.php index c6826795..ce93280b 100644 --- a/app/Services/ShippingService.php +++ b/app/Services/ShippingService.php @@ -23,7 +23,7 @@ class ShippingService //如果该模板下无运费规则,则直接包邮 if ($rules->count() > 0) { //按包邮/计重 - $rules = $rules->sortBy('type'); + $rules = $rules->sortBy('type');//优先计算包邮 foreach ($rules as $rule) { $canShipping = false; $_ruleInfo = json_decode($rule->info, true);