CardBatchValidate.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. /**
  3. * CardBatchValidate.php
  4. * User: ZhouBenXu
  5. * Date: 2024/6/27
  6. * Time: 上午9:54
  7. * Notes:
  8. */
  9. namespace app\admin\validate\card;
  10. use support\Validate;
  11. class CardBatchValidate extends Validate
  12. {
  13. protected $rule = [
  14. 'card_batch_id' => 'require', // 批次id
  15. 'join_card_batch_user_id' => 'require', // 批次创建用户 user_id
  16. 'join_card_batch_category_id' => 'require', // 批次卡分类ID
  17. 'card_batch_status' => 'require', // 批次状态 CREATE=已创建|PRODUCTED=制作完成|ENABLED=启用|DISABLED=禁用
  18. 'card_batch_name' => 'require', // 卡批次名称
  19. 'card_batch_prefix' => 'require', // 卡批次前缀
  20. 'card_batch_suffix' => 'require', // 卡批次后缀
  21. 'card_batch_serial_begin' => 'require', // 卡批次序号起始
  22. 'card_batch_serial_end' => 'require', // 卡批次序号结束
  23. 'card_batch_amount' => 'require', // 卡批次面额
  24. 'card_batch_added' => 'require', // 卡批次增值赠送
  25. 'card_batch_validtimes' => 'require', // 卡批次有效期时间戳 0=永久 天
  26. 'validtimes_status' => 'require', // 修改时有效期状态 0 永久 1增加 2减少
  27. 'page' => 'require', // 页码
  28. 'pageSize' => 'require', // 分页条数
  29. 'card_batch_ids' => 'require', // 批次ids
  30. ];
  31. protected $message = [];
  32. protected $scene = [
  33. 'add' => ['join_card_batch_user_id', 'join_card_batch_category_id', 'card_batch_status', 'card_batch_name', 'card_batch_prefix', 'card_batch_suffix', 'card_batch_serial_begin', 'card_batch_serial_end', 'card_batch_amount', 'card_batch_added', 'card_batch_validtimes'],
  34. 'save' => ['join_card_batch_user_id','card_batch_id','validtimes_status','card_batch_name'],
  35. 'delete' => ['card_batch_ids'],
  36. 'list' => ['page','pageSize'],
  37. 'info' => ['card_batch_id']
  38. ];
  39. }