Adwords.php 1.2 KB

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