DepositCard.php 838 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. namespace App\Models;
  3. use App\Traits\ModelHelpers;
  4. use Illuminate\Database\Eloquent\Model;
  5. class DepositCard extends Model
  6. {
  7. use ModelHelpers;
  8. protected $table = 'deposit_cards';
  9. //
  10. protected $guarded = [];
  11. const GIVE_OK = 1;
  12. const GIVE_NO = 0;
  13. public static $giveMaps = [
  14. self::GIVE_NO => '不可赠送',
  15. self::GIVE_OK => '可赠送',
  16. ];
  17. const STATUS_OK = 1;
  18. const STATUS_NO = 0;
  19. public static $statusMaps = [
  20. self::STATUS_OK=>'启用',
  21. self::STATUS_NO=>'停用',
  22. ];
  23. const DISCOUNT_YES = 1;
  24. const DISCOUNT_NO = 0;
  25. public static $discountMaps = [
  26. self::DISCOUNT_NO => '无折扣',
  27. self::DISCOUNT_YES => '有折扣',
  28. ];
  29. public function area(){
  30. return $this->belongsTo(Area::class,'area_id','id');
  31. }
  32. }