修改命名空间
This commit is contained in:
parent
863cb666bc
commit
fc00ef9728
@ -12,7 +12,7 @@ use app\api\logic\LocalStoreLogic;
|
||||
use EasyWeChat\Factory;
|
||||
use think\facade\Db;
|
||||
use think\facade\Config as FileConfig;
|
||||
use app\api\validate\LocalStoreGoodsValidate;
|
||||
use app\api\validate\LocalStoreGoods;
|
||||
|
||||
class LocalStore extends Api
|
||||
{
|
||||
@ -270,6 +270,6 @@ class LocalStore extends Api
|
||||
public function addGoods()
|
||||
{
|
||||
$form = $this->request->post();
|
||||
(new LocalStoreGoodsValidate())->goCheck();
|
||||
(new LocalStoreGoods())->goCheck();
|
||||
}
|
||||
}
|
||||
@ -3,7 +3,7 @@ namespace app\api\validate;
|
||||
|
||||
use think\Validate;
|
||||
|
||||
class LocalStoreGoodsValidate extends Validate
|
||||
class LocalStoreGoods extends Validate
|
||||
{
|
||||
protected $rule = [
|
||||
'lstore_id' => 'require',
|
||||
@ -18,9 +18,12 @@ class LocalStoreGoodsValidate extends Validate
|
||||
'url.require' => '商品图片不能为空',
|
||||
];
|
||||
|
||||
protected $scene = [
|
||||
'add' => ['lstore_id', 'title', 'price', 'url'],
|
||||
];
|
||||
|
||||
public function checkPrice($value)
|
||||
{
|
||||
dump($value);die;
|
||||
$pattern = '/^\d+(\.\d{1,2})?$/';
|
||||
if (!preg_match($pattern, $value)) {
|
||||
return "价格或金额格式不正确";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user