| 12345678910111213141516171819202122232425262728293031323334353637 |
- <?php
- // +----------------------------------------------------------------------
- // | LARAVEL8.0 框架 [ LARAVEL ][ RXThinkCMF ]
- // +----------------------------------------------------------------------
- // | 版权所有 2017~2021 LARAVEL研发中心
- // +----------------------------------------------------------------------
- // | 官方网站: http://www.laravel.cn
- // +----------------------------------------------------------------------
- // | Author: laravel开发员 <laravel.qq.com>
- // +----------------------------------------------------------------------
- namespace App\Models;
- /**
- * 文章类型-模型
- * @author laravel开发员
- * @since 2020/11/11
- * @package App\Models
- */
- class ArticleCateModel extends BaseModel
- {
- // 设置数据表
- protected $table = 'article_cates';
- /**
- * 分类文章
- * @return \Illuminate\Database\Eloquent\Relations\HasMany
- */
- public function articles()
- {
- return $this->hasMany(ArticleModel::class, 'cate_id', 'id')
- ->where(['status'=>1,'mark'=>1])
- ->orderBy('sort','desc')
- ->orderBy('id','desc');
- }
- }
|