From 2b412f4d6b4cef92a3cbfb0361aabc884479a8c0 Mon Sep 17 00:00:00 2001 From: liapples Date: Tue, 31 Aug 2021 11:59:12 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=AE=A2=E9=87=91/=E5=AE=9A?= =?UTF-8?q?=E9=87=91=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/AdminAgent/Controllers/AgentProductController.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/AdminAgent/Controllers/AgentProductController.php b/app/AdminAgent/Controllers/AgentProductController.php index 2f1b258..f440eae 100644 --- a/app/AdminAgent/Controllers/AgentProductController.php +++ b/app/AdminAgent/Controllers/AgentProductController.php @@ -318,13 +318,21 @@ class AgentProductController extends AdminController if (array_key_exists('guide_id', $form->input())) { $form->guide_id = $form->guide_id ?? 0; } + + //订金 if ($form->earnest <= 0 || $form->earnest_timeout <= 0) { $form->earnest = 0; $form->earnest_timeout = 0; + } else if ($form->earnest > $form->price) { + return $form->response()->error('订金不能大于商品价'); } + + //定金 if ($form->deposit <= 0 || $form->deposit_timeout <= 0) { $form->deposit = 0; $form->deposit_timeout = 0; + } else if ($form->earnest > $form->price) { + return $form->response()->error('定金不能大于商品价'); } //不允许编辑的字段