阶段更新
This commit is contained in:
@@ -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;
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user