'不限次', self::LIMIT_TIMES_YES => '限次', ]; const DISCOUNT_YES = 1; const DISCOUNT_NO = 0; public static $discountMaps = [ self::DISCOUNT_NO => '无折扣', self::DISCOUNT_YES => '有折扣', ]; const STATUS_OK = 1; const STATUS_NO = 0; public static $statusMaps = [ self::STATUS_OK=>'启用', self::STATUS_NO=>'停用', ]; const GIVE_OK = 1; const GIVE_NO = 0; public static $giveMaps = [ self::GIVE_OK=>'可赠送', self::GIVE_NO=>'不可赠送', ]; public function areaRidingCard(){ return $this->belongsToMany( Area::class, 'card_riding_area', 'riding_card_id', 'area_id' )->withTimestamps(); } public function delete() { $this->areaRidingCard()->detach(); return parent::delete(); } // // public function card(){ // return $this->morphMany(InviteNewUsersGiveGiftLog::class,'gift','card','id'); // } }