调整样式
This commit is contained in:
@@ -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 = '')
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user