Card.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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\ais\validate;
  9. use think\Validate;
  10. class Card extends Validate{
  11. protected $rule = [
  12. 'id' => 'require|number',
  13. 'store_id' => 'require|number',
  14. 'name' => 'require',
  15. 'price' => 'require|float|>:0',
  16. 'locktime' => 'require|date',
  17. 'tips' => 'require',
  18. 'coupon_id' => 'require|integer',
  19. 'amount' => 'require|integer|>:0',
  20. 'howmuch' => 'require|integer',
  21. 'content' => 'require',
  22. 'num' => 'require|integer|>:0',
  23. ];
  24. protected $message = [
  25. 'id' => '编辑ID丢失',
  26. 'store_id' => '当前店铺不存在',
  27. 'name' => '储值活动名称必须填写',
  28. 'price' => '付款金额必须输入',
  29. 'locktime' => '活动结束日期必须输入',
  30. 'tips' => '使用须知必须输入',
  31. 'coupon_id' => '必须选择优惠券',
  32. 'amount' => '储值额度必须填写',
  33. 'howmuch' => '使用门槛必须填写', //客户端创建储值活动
  34. 'content' => '使用须知必须输入',
  35. 'num' => '发现数量必须输入',
  36. ];
  37. protected $scene = [
  38. 'edit' => ['id','store_id','name','price','amount','howmuch','name','tips','content','locktime','num'],
  39. 'api' => ['id','name','price','amount','howmuch','name','tips','content','locktime','num'],
  40. ];
  41. }