From 33bf92de0f9e2173c384a180c490bda8f1ac41da Mon Sep 17 00:00:00 2001 From: wangxiaowei Date: Thu, 22 Aug 2024 09:34:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=AC=E5=9C=B0=E7=94=9F=E6=B4=BB=E5=95=86?= =?UTF-8?q?=E5=93=81=E6=B7=BB=E5=8A=A0=E9=AA=8C=E8=AF=81=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/validate/LocalStoreGoodsValidate.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/app/api/validate/LocalStoreGoodsValidate.php b/app/api/validate/LocalStoreGoodsValidate.php index 7e81a0c6..c31b2fe4 100755 --- a/app/api/validate/LocalStoreGoodsValidate.php +++ b/app/api/validate/LocalStoreGoodsValidate.php @@ -26,11 +26,10 @@ class LocalStoreGoodsValidate extends Validate public function checkPrice($value, $data, $rule) { - dump($value);dump($data);dump($rule);die; -// $pattern = '/^\d+(\.\d{1,2})?$/'; -// if (!preg_match($pattern, $value)) { -// return "价格或金额格式不正确"; -// } -// return true; + $pattern = '/^\d+(\.\d{1,2})?$/'; + if (!preg_match($pattern, $value)) { + return "价格或金额格式不正确"; + } + return true; } } \ No newline at end of file