12345678910111213141516171819202122232425262728293031323334353637383940 |
- <?php
- namespace App\Models;
- use App\Traits\ModelHelpers;
- use Illuminate\Database\Eloquent\Model;
- class DepositCard extends Model
- {
- use ModelHelpers;
- protected $table = 'deposit_cards';
- //
- protected $guarded = [];
- const GIVE_OK = 1;
- const GIVE_NO = 0;
- public static $giveMaps = [
- self::GIVE_NO => '不可赠送',
- self::GIVE_OK => '可赠送',
- ];
- const STATUS_OK = 1;
- const STATUS_NO = 0;
- public static $statusMaps = [
- self::STATUS_OK=>'启用',
- self::STATUS_NO=>'停用',
- ];
- const DISCOUNT_YES = 1;
- const DISCOUNT_NO = 0;
- public static $discountMaps = [
- self::DISCOUNT_NO => '无折扣',
- self::DISCOUNT_YES => '有折扣',
- ];
- public function area(){
- return $this->belongsTo(Area::class,'area_id','id');
- }
- }
|