本地生活商品添加验证规则

This commit is contained in:
wangxiaowei 2024-08-22 09:20:00 +08:00
parent b6e008e151
commit a9bd004e8e

@ -24,10 +24,11 @@ class LocalStoreGoodsValidate extends Validate
public function checkPrice($value)
{
$pattern = '/^\d+(\.\d{1,2})?$/';
if (!preg_match($pattern, $value)) {
return "价格或金额格式不正确";
}
return true;
dump($value);die;
// $pattern = '/^\d+(\.\d{1,2})?$/';
// if (!preg_match($pattern, $value)) {
// return "价格或金额格式不正确";
// }
// return true;
}
}