2018-03-17 12:59:53 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
2019-07-16 03:44:31 +08:00
|
|
|
use App\Contracts\Model;
|
2018-03-20 09:50:40 +08:00
|
|
|
|
|
|
|
class UserAward extends Model
|
2018-03-17 12:59:53 +08:00
|
|
|
{
|
|
|
|
public $table = 'user_awards';
|
|
|
|
|
2018-03-21 08:40:19 +08:00
|
|
|
protected $fillable = [
|
2018-03-17 12:59:53 +08:00
|
|
|
'user_id',
|
2018-08-27 00:40:04 +08:00
|
|
|
'award_id',
|
2018-03-17 12:59:53 +08:00
|
|
|
];
|
2018-03-17 13:18:03 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
|
|
|
*/
|
|
|
|
public function award()
|
|
|
|
{
|
|
|
|
return $this->belongsTo(Award::class, 'award_id');
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
|
|
|
*/
|
|
|
|
public function user()
|
|
|
|
{
|
|
|
|
return $this->belongsTo(User::class, 'user_id');
|
|
|
|
}
|
2018-03-17 12:59:53 +08:00
|
|
|
}
|