<?php

namespace App\Models\Gteam;

use Illuminate\Database\Eloquent\Model;

/**
 * App\Models\Gteam\RoomModel
 *
 * @property int $id
 * @property \Illuminate\Support\Carbon $created_at 创建时间
 * @property \Illuminate\Support\Carbon $updated_at 更新时间
 * @property string|null $name 房间名称
 * @property int $number 房间人数
 * @property string $type 房间类型cj_wx:吃鸡微信|cj_qq:吃鸡QQ|wz_wx:王者微信|wz_qq王者QQ
 * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Gteam\RoomMemberModel[] $members
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Gteam\RoomModel newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Gteam\RoomModel newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Gteam\RoomModel query()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Gteam\RoomModel whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Gteam\RoomModel whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Gteam\RoomModel whereName($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Gteam\RoomModel whereNumber($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Gteam\RoomModel whereType($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Gteam\RoomModel whereUpdatedAt($value)
 * @mixin \Eloquent
 */
class RoomModel extends Model
{
    //
    protected $table = 'kdgx_gteam_room';

    protected $dateFormat = 'U';

    protected $fillable = ['name', 'number', 'type'];


    public function members()
    {
        return $this->hasMany(RoomMemberModel::class, 'room_id', 'id');
    }
}
