2019-03-30 11:38:30 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
|
|
|
|
class Report extends Model
|
|
|
|
{
|
|
|
|
public const CREATED_AT = 'report_at';
|
|
|
|
public const UPDATED_AT = null;
|
|
|
|
|
2019-04-19 19:36:36 +08:00
|
|
|
public const PENDING = 0;
|
2019-03-30 11:38:30 +08:00
|
|
|
public const RESOLVED = 1;
|
|
|
|
public const REJECTED = 2;
|
|
|
|
|
|
|
|
protected $casts = [
|
|
|
|
'tid' => 'integer',
|
|
|
|
'uploader' => 'integer',
|
|
|
|
'reporter' => 'integer',
|
|
|
|
'status' => 'integer',
|
|
|
|
];
|
|
|
|
|
|
|
|
public function texture()
|
|
|
|
{
|
|
|
|
return $this->belongsTo(Texture::class, 'tid', 'tid');
|
|
|
|
}
|
|
|
|
|
|
|
|
public function informer()
|
|
|
|
{
|
|
|
|
return $this->belongsTo(User::class, 'reporter', 'uid');
|
|
|
|
}
|
|
|
|
}
|