| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 | 
							- <?php
 
- namespace App\Models;
 
- use Illuminate\Database\Eloquent\Builder;
 
- use Illuminate\Foundation\Auth\User as Authenticatable;
 
- use Illuminate\Notifications\Notifiable;
 
- use Laravel\Sanctum\HasApiTokens;
 
- /**
 
-  * @mixin Builder
 
-  * @method static Builder|static where($column, $operator = null, $value = null, $boolean = 'and')
 
-  */
 
- class RoomUser extends Authenticatable
 
- {
 
-     use HasApiTokens, Notifiable;
 
-     protected $table = 'room_users';
 
-     protected $hidden = ['created_at', 'updated_at'];
 
-     protected $fillable = ['room_id', 'member_id', 'game_id', 'status', 'score', 'screenshot', 'game_id', 'first_name'];
 
-     public function room()
 
-     {
 
-         return $this->belongsTo(Room::class, 'room_id', 'room_id');
 
-     }
 
-     protected function getBrokerageAttribute($value)
 
-     {
 
-         return floatval($value);
 
-     }
 
-     protected function getScoreAttribute($value)
 
-     {
 
-         return floatval($value);
 
-     }
 
-     protected function getRealScoreAttribute($value)
 
-     {
 
-         return floatval($value);
 
-     }
 
-     protected function getCreatedAtAttribute($value)
 
-     {
 
-         return \Carbon\Carbon::parse($value)->setTimezone('Asia/Shanghai')->format('Y-m-d H:i:s');
 
-     }
 
-     protected function getUpdatedAtAttribute($value)
 
-     {
 
-         return \Carbon\Carbon::parse($value)->setTimezone('Asia/Shanghai')->format('Y-m-d H:i:s');
 
-     }
 
- }
 
 
  |