From 1992a1e55b67907e330b2da7ce368964cacd3545 Mon Sep 17 00:00:00 2001 From: ctexthuang Date: Mon, 10 Mar 2025 09:43:27 +0800 Subject: [PATCH] feat : dispense --- app/Exception/Handler/ErrExceptionHandler.php | 2 +- app/Service/Admin/Coupon/DispenseAddService.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Exception/Handler/ErrExceptionHandler.php b/app/Exception/Handler/ErrExceptionHandler.php index 4799d10..cf5f2e4 100644 --- a/app/Exception/Handler/ErrExceptionHandler.php +++ b/app/Exception/Handler/ErrExceptionHandler.php @@ -37,7 +37,7 @@ class ErrExceptionHandler extends ExceptionHandler $urlArr = explode('/',$this->request->path()); $result = match ($urlArr[0]) { 'api' => $this->apiReturn->error($throwable->getMessage(),$throwable->getCode()), - 'admin', 'common', 'web' => $this->adminReturn->error($throwable->getMessage(),$throwable->getCode()), + 'admin', 'common' => $this->adminReturn->error($throwable->getMessage(),$throwable->getCode()), default => null, }; diff --git a/app/Service/Admin/Coupon/DispenseAddService.php b/app/Service/Admin/Coupon/DispenseAddService.php index cd77087..48496d5 100644 --- a/app/Service/Admin/Coupon/DispenseAddService.php +++ b/app/Service/Admin/Coupon/DispenseAddService.php @@ -192,7 +192,7 @@ class DispenseAddService extends BaseService $insertModel->appoint_group = $this->groupType; $insertModel->claim_rule = $this->claimRule; $insertModel->claim_value = $this->request->input('claim_value'); - $insertModel->appoint_value = json_encode($this->appointValue); + $insertModel->appoint_value = !empty($this->appointValue) ? json_encode($this->appointValue) : null; $insertModel->validity_time_type = $this->request->input('validity_time_type'); $insertModel->validity_time_value = json_encode($this->request->input('validity_time_value')); $insertModel->remark = $this->request->input('remark');