Adwords.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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\green\validate;
  9. use think\Validate;
  10. class Adwords extends Validate{
  11. protected $rule = [
  12. 'id' => 'require|number',
  13. 'operate_id' => 'require|number|>:0',
  14. 'picture' => 'require',
  15. 'sort' => 'require|number',
  16. 'title' => 'require',
  17. 'link' => 'require',
  18. 'open_type' => 'require',
  19. 'group' => 'require',
  20. 'api' => 'require|alphaNum',
  21. ];
  22. protected $message = [
  23. 'id' => '编辑资源不存在',
  24. 'operate_id' => '运营商必须选择',
  25. 'sort' => '排序序号必须填写',
  26. 'picture' => '图片必须选择',
  27. 'title' => '标题必须填写',
  28. 'group' => '广告位必须选择',
  29. 'link' => '链接地址必须填写',
  30. 'api' => 'API名称必须填写,切必须是数字或字母',
  31. ];
  32. protected $scene = [
  33. 'sort' => ['id', 'sort'],
  34. 'api' => ['api'],
  35. 'add' => ['title', 'group_id', 'picture', 'link', 'open_type'],
  36. 'edit' => ['id', 'group_id', 'title', 'picture', 'link', 'open_type'],
  37. ];
  38. }