调整样式

This commit is contained in:
2021-12-20 13:29:48 +08:00
parent 49da62127f
commit 59a7f8f906
3 changed files with 60 additions and 22 deletions

View File

@@ -57,7 +57,7 @@ function getOneArticleBYCate($categoryId, $result = '')
* @param int $recommen
* @return \App\Models\Article
*/
function getArticlesBYCate($categoryId, $take = 8, $recommen = 0)
function getArticlesBYCate($categoryId, int $take = 8, $recommen = 0)
{
$cate = Category::find($categoryId);
$ids = $cate ? $cate->getAllChildrenId() : [];
@@ -75,6 +75,26 @@ function getArticlesBYCate($categoryId, $take = 8, $recommen = 0)
return $articles;
}
/**
* Notes: 获取有图片的文章
*
* @Author: 玄尘
* @Date: 2021/12/20 13:22
* @param $categoryId
* @param $take
* @return mixed
*/
function getHasCoverArticlesByCate($categoryId, $take = 8)
{
return Article::where('status', 1)
->ByCategory([$categoryId])
->whereNotNull('cover')
->latest('sort')
->latest()
->take($take)
->get();
}
//获取子分类
function getCateChild($categoryId, $take = '')
{