Coupon.php 489 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. namespace app\common\model;
  3. use think\Model;
  4. /**
  5. * 配置模型
  6. */
  7. class Coupon extends Model
  8. {
  9. protected $append=[
  10. 'type_desc',
  11. ];
  12. const C1=1;
  13. const C2=2;
  14. const C3=3;
  15. const C4=4;
  16. public static $types=[
  17. self::C1=>'代金券',
  18. self::C2=>'满减券',
  19. self::C3=>'折扣券',
  20. self::C4=>'新用户下单券',
  21. ];
  22. public function getTypeDescAttr($v,$d){
  23. return self::$types[$d['type']]??'-';
  24. }
  25. }