You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
768 B
39 lines
768 B
|
1 week ago
|
<?php
|
||
|
|
|
||
|
|
namespace App\Models;
|
||
|
|
|
||
|
|
use Illuminate\Database\Eloquent\Model;
|
||
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||
|
|
|
||
|
|
class News extends Model
|
||
|
|
{
|
||
|
|
use SoftDeletes;
|
||
|
|
|
||
|
|
protected $table = 'news';
|
||
|
|
|
||
|
|
protected $fillable = [
|
||
|
|
'title',
|
||
|
|
'category_dict_item_id',
|
||
|
|
'source',
|
||
|
|
'cover_url',
|
||
|
|
'summary',
|
||
|
|
'content_html',
|
||
|
|
'status',
|
||
|
|
'published_at',
|
||
|
|
'source_url',
|
||
|
|
'source_site',
|
||
|
|
'crawl_job_id',
|
||
|
|
];
|
||
|
|
|
||
|
|
protected $casts = [
|
||
|
|
'status' => 'integer',
|
||
|
|
'published_at' => 'datetime',
|
||
|
|
];
|
||
|
|
|
||
|
|
public function categoryItem(): BelongsTo
|
||
|
|
{
|
||
|
|
return $this->belongsTo(DictItem::class, 'category_dict_item_id');
|
||
|
|
}
|
||
|
|
}
|