1234567891011121314151617181920212223242526272829303132333435 |
- <?php
- namespace app\admin\validate\medical;
- use think\Validate;
- class ShopValidate extends Validate
- {
- protected $rule = [
- 'shop_id' => 'require|integer',
- 'shop_name' => 'require|chsDash',
- 'shop_real_name' => 'require|chsDash',
- 'shop_logo' => 'regex:/^[0-9a-zA-Z\/\.]+$/',
- 'shop_img' => 'regex:/^[0-9a-zA-Z\.\/]+$/',
- 'shop_label' => '/^[\x{4e00}-\x{9fa5}a-zA-Z0-9\_\-\,\s]+$/u',
- 'shop_category_id' => 'require|integer',
- 'shop_score' => 'require|float',
- 'shop_type' => 'require|in:1,2,3,4,5',
- 'shop_is_audit' => 'require|in:0,1',
- 'shop_lat' => 'regex:/^[0-9a-zA-Z\.]+$/',
- 'shop_lng' => 'regex:/^[0-9a-zA-Z\.]+$/',
- 'shop_phone' => 'mobile',
- 'shop_sort' => 'require|integer',
- 'shop_status' => 'require|in:0,1'
- ];
- protected $message = [];
- protected $scene = [
- 'add' => ['shop_name', 'shop_real_name', 'shop_logo', 'shop_img', 'shop_label', 'shop_category_id', 'shop_score', 'shop_type',
- 'shop_is_audit', 'shop_lat', 'shop_lng', 'shop_phone', 'shop_sort', 'shop_status'],
- 'update' => ['shop_id', 'shop_name', 'shop_real_name', 'shop_logo', 'shop_img', 'shop_label', 'shop_category_id', 'shop_score',
- 'shop_type', 'shop_is_audit', 'shop_lat', 'shop_lng', 'shop_phone', 'shop_sort', 'shop_status'],
- ];
- }
|