Category.php 928 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2017 https://www.sapixx.com All rights reserved.
  4. * @license Licensed (http://www.apache.org/licenses/LICENSE-2.0).
  5. * @author pillar<ltmn@qq.com>
  6. * 商品分类
  7. */
  8. namespace app\allwin\validate;
  9. use think\Validate;
  10. class Category extends Validate{
  11. protected $rule = [
  12. 'token' => 'require|max:25|token',
  13. 'id' => 'require|number',
  14. 'sort' => 'require|number',
  15. 'title' => 'require',
  16. 'content' => 'require',
  17. ];
  18. protected $message = [
  19. 'id' => 'ID丢失',
  20. 'sort' => '排序序号必须填写',
  21. 'title' => '分类名称必须填写',
  22. 'content' => '分类别名必须填写',
  23. ];
  24. protected $scene = [
  25. 'sort' => ['id', 'sort'],
  26. 'add' => ['title', 'content'],
  27. 'edit' => ['id', 'title', 'content'],
  28. 'save' => ['title','content'],
  29. ];
  30. }