阶段更新

This commit is contained in:
2021-10-11 13:09:29 +08:00
parent d89bc90cef
commit 11b9e2ae76
31 changed files with 1095 additions and 659 deletions

View File

@@ -84,7 +84,7 @@ function getCateChild($categoryId)
{
return Category::where('status', 1)
->where('parent_id', $categoryId)
->orderBy('order', 'asc')
->orderBy('order', 'desc')
->get();
}
@@ -126,6 +126,14 @@ function getOneAdvertByCate($categoryId, $result = '')
}
}
function getAdvertsByCate($categoryId, $take = '8')
{
return Advert::where('category_id', $categoryId)
->latest()
->take($take)
->get();
}
function getVideoByCate($categoryId, $result = '')
{
$video = Video::where('category_id', $categoryId)
@@ -151,3 +159,24 @@ function getVideosByCate($categoryId, $take = '8')
->get();
}
function dateLocalMonth($m)
{
$months = [
'1' => '一月',
'2' => '二月',
'3' => '三月',
'4' => '四月',
'5' => '五月',
'6' => '六月',
'7' => '七月',
'8' => '八月',
'9' => '九月',
'10' => '十月',
'11' => '十一月',
'12' => '十二月',
];
return $months[$m] ?? $m;
}