本地生活商品添加验证规则
This commit is contained in:
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;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user