<?php

namespace App\Models\Goodnight;

use Illuminate\Database\Eloquent\Model;

/**
 * App\Models\Goodnight\EnterModel
 *
 * @property int $id
 * @property int $uid uid
 * @property string $type 类型
 * @property int $activity_id 活动ID
 * @property int $room_id 房间ID
 * @property \Illuminate\Support\Carbon $created_at
 * @property \Illuminate\Support\Carbon $updated_at
 * @property int $match_at 匹配时间
 * @property-read \App\Models\Goodnight\ActivityModel $activity
 * @property-read \App\Models\Goodnight\RoomModel $room
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Goodnight\EnterModel newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Goodnight\EnterModel newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Goodnight\EnterModel query()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Goodnight\EnterModel whereActivityId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Goodnight\EnterModel whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Goodnight\EnterModel whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Goodnight\EnterModel whereMatchAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Goodnight\EnterModel whereRoomId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Goodnight\EnterModel whereType($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Goodnight\EnterModel whereUid($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Goodnight\EnterModel whereUpdatedAt($value)
 * @mixin \Eloquent
 */
class EnterModel extends Model
{
    //
    protected $table = 'kdgx_goodnight_enters';

    protected $dateFormat = "U";

    protected $fillable = ['uid', 'type', 'activity_id'];


    public function activity()
    {
        return $this->belongsTo(ActivityModel::class);
    }

    public function room()
    {
        return $this->belongsTo(RoomModel::class);
    }
}
