项目列表
This commit is contained in:
@@ -33,4 +33,19 @@ class HomeController extends BaseController
|
||||
'轮播图列表'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 项目列表
|
||||
* @Method GET
|
||||
* @return JsonResponse
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function projectList(): JsonResponse
|
||||
{
|
||||
return jok(
|
||||
$this->service->projectList(),
|
||||
'项目列表'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ class HomeService extends BaseService
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取项目列表
|
||||
* 获取精选项目
|
||||
* @return array
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
@@ -50,6 +50,23 @@ class HomeService extends BaseService
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function projectList(): array
|
||||
{
|
||||
$this->where[] = [ 'status', '=', 1 ];
|
||||
$this->with = [
|
||||
'frameworks:id,name',
|
||||
'labels:id,name',
|
||||
'category:id,name',
|
||||
];
|
||||
return $this->getPageList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取轮播图
|
||||
* @return array
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function carousel(): array
|
||||
{
|
||||
$this->where[] = [ 'is_carousel', '=', 1 ];
|
||||
|
||||
Reference in New Issue
Block a user