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);