取消计算运费调试
parent
41e8fbf13b
commit
385cf0d936
|
|
@ -3,16 +3,12 @@
|
||||||
namespace App\Admin\Controllers;
|
namespace App\Admin\Controllers;
|
||||||
|
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use App\Services\ShippingService;
|
|
||||||
use Dcat\Admin\Layout\Content;
|
use Dcat\Admin\Layout\Content;
|
||||||
|
|
||||||
class HomeController extends Controller
|
class HomeController extends Controller
|
||||||
{
|
{
|
||||||
public function index(Content $content)
|
public function index(Content $content)
|
||||||
{
|
{
|
||||||
$shippingService = new ShippingService();
|
|
||||||
$amount = $shippingService->countShippingAmount(3560, 2000, 1, 2225);
|
|
||||||
dd($amount);
|
|
||||||
return $content
|
return $content
|
||||||
->header('Dashboard')
|
->header('Dashboard')
|
||||||
->description('Description...');
|
->description('Description...');
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ class ShippingService
|
||||||
//如果该模板下无运费规则,则直接包邮
|
//如果该模板下无运费规则,则直接包邮
|
||||||
if ($rules->count() > 0) {
|
if ($rules->count() > 0) {
|
||||||
//按包邮/计重
|
//按包邮/计重
|
||||||
$rules = $rules->sortBy('type');
|
$rules = $rules->sortBy('type');//优先计算包邮
|
||||||
foreach ($rules as $rule) {
|
foreach ($rules as $rule) {
|
||||||
$canShipping = false;
|
$canShipping = false;
|
||||||
$_ruleInfo = json_decode($rule->info, true);
|
$_ruleInfo = json_decode($rule->info, true);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue