GoodsValidate.php 827 B

12345678910111213141516171819202122232425
  1. <?php
  2. namespace app\admin\validate\at_home;
  3. use support\Validate;
  4. class GoodsValidate extends Validate
  5. {
  6. protected $rule = [
  7. 'goods_id' => 'require|integer',
  8. 'goods_category_id' => 'require|in:108,109,110,111,112,113',
  9. 'goods_name|商品名称' => 'require',
  10. 'goods_img|图片' => 'require|regex:/^[0-9a-zA-Z\.\/]+$/',
  11. 'goods_mobile|联系电话' => 'require|mobile',
  12. 'goods_status|状态' => 'require|in:0,1',
  13. 'goods_sort|排序' => 'require|integer'
  14. ];
  15. protected $message = [];
  16. protected $scene = [
  17. 'add' => ['goods_category_id', 'goods_name', 'goods_img', 'goods_mobile', 'goods_status', 'goods_sort'],
  18. 'update' => ['goods_id', 'goods_category_id', 'goods_name', 'goods_img', 'goods_mobile', 'goods_status', 'goods_sort'],
  19. ];
  20. }