控制台应用,yzncms本身基于tp5.1框架,里面的队列用不了,bug,坑
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Category.php 1.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | Yzncms [ 御宅男工作室 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2018 http://yzncms.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
  8. // +----------------------------------------------------------------------
  9. // | Author: 御宅男 <530765310@qq.com>
  10. // +----------------------------------------------------------------------
  11. // +----------------------------------------------------------------------
  12. // | 栏目验证
  13. // +----------------------------------------------------------------------
  14. namespace app\admin\validate\cms;
  15. use think\Validate;
  16. class Category extends Validate
  17. {
  18. //定义验证规则
  19. protected $rule = [
  20. 'parentid|上级栏目' => 'require|number',
  21. 'modelid|所属模型' => 'require|number',
  22. 'type|栏目类型' => 'require|in:1,2,3',
  23. 'catname|栏目标题' => 'require',
  24. 'catdir|唯一标识' => 'require|alphaDash',
  25. 'listorder|栏目排序' => 'require|number',
  26. 'status|栏目状态' => 'require|in:0,1',
  27. 'url|链接地址' => 'require',
  28. ];
  29. //定义验证提示
  30. protected $message = [
  31. 'modelid.number' => '所属模型不得为空',
  32. ];
  33. protected $scene = [
  34. 'page' => ['parentid', 'type', 'catname', 'catdir', 'image', 'listorder', 'status'],
  35. 'list' => ['parentid', 'modelid', 'type', 'catname', 'catdir', 'image', 'listorder', 'status'],
  36. 'link' => ['parentid', 'type', 'catname', 'catdir', 'image', 'listorder', 'status', 'url'],
  37. ];
  38. }