29 lines
521 B
PHP
29 lines
521 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Models\Traits\BelongsToCategory;
|
|
use App\Models\Traits\HasOneCover;
|
|
|
|
class Article extends Model
|
|
{
|
|
|
|
use HasOneCover, BelongsToCategory;
|
|
|
|
const POSITION_A = 1;
|
|
const POSITION_B = 2;
|
|
const POSITION_C = 3;
|
|
|
|
const POSITIONS = [
|
|
self::POSITION_A => '院所新闻',
|
|
self::POSITION_B => '科学研究',
|
|
self::POSITION_C => '科技成果',
|
|
];
|
|
|
|
public function getLinkAttribute()
|
|
{
|
|
return route('article.show', $this);
|
|
}
|
|
|
|
}
|