Files
new_haai/app/Models/Article.php
2021-02-03 17:24:51 +08:00

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);
}
}