From 2839c115f929723f133e78682422680397b30332 Mon Sep 17 00:00:00 2001 From: liaofei <136327134@qq.com> Date: Fri, 16 Jun 2023 17:26:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AF=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crmeb/app/adminapi/controller/v1/order/StoreOrder.php | 8 ++++++++ crmeb/crmeb/services/express/storage/Express.php | 6 +++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/crmeb/app/adminapi/controller/v1/order/StoreOrder.php b/crmeb/app/adminapi/controller/v1/order/StoreOrder.php index da3b13f54..3e253858c 100644 --- a/crmeb/app/adminapi/controller/v1/order/StoreOrder.php +++ b/crmeb/app/adminapi/controller/v1/order/StoreOrder.php @@ -293,6 +293,7 @@ class StoreOrder extends AuthController ['day_type', 0], //顺丰传 0今天,1明天,2后台 ['pickup_time', []],//开始时间 9:00,结束时间 10:00 开始时间和结束时间之间不能小于一个小时 + ['service_type', ''],//快递业务类型 ]); if (!$id) { return app('json')->fail(100100); @@ -325,8 +326,15 @@ class StoreOrder extends AuthController ['address', ''], ['weight', ''], ['service_type', ''], + ['cart_ids', []], ]); + foreach ($data['cart_ids'] as $cart) { + if (!isset($cart['cart_id']) || !$cart['cart_id'] || !isset($cart['cart_num']) || !$cart['cart_num']) { + return app('json')->fail(400159); + } + } + return app('json')->success($services->express()->getPrice($data)); } diff --git a/crmeb/crmeb/services/express/storage/Express.php b/crmeb/crmeb/services/express/storage/Express.php index bb8a86bb3..9421f4a22 100644 --- a/crmeb/crmeb/services/express/storage/Express.php +++ b/crmeb/crmeb/services/express/storage/Express.php @@ -170,13 +170,13 @@ class Express extends BaseExpress */ public function getPrice(array $data) { - if (!empty($data['kuaidicom'])) { + if (empty($data['kuaidicom'])) { throw new ApiException('快递编码必须填写'); } - if (!empty($data['send_address'])) { + if (empty($data['send_address'])) { throw new ApiException('寄件地址必须填写'); } - if (!empty($data['address'])) { + if (empty($data['address'])) { throw new ApiException('收件地址必须填写'); } $param = [