diff --git a/app/adminapi/logic/custom_service/CustomServiceLogic.php b/app/adminapi/logic/custom_service/CustomServiceLogic.php index 79fe53a3b..5eb4f40e4 100644 --- a/app/adminapi/logic/custom_service/CustomServiceLogic.php +++ b/app/adminapi/logic/custom_service/CustomServiceLogic.php @@ -127,6 +127,9 @@ class CustomServiceLogic extends BaseLogic */ public static function detail($params): array { - return CustomService::findOrEmpty($params['id'])->toArray(); + $customService = CustomService::findOrEmpty($params['id']); + $customService->project = $customService->project; + $customService->custom = $customService->custom; + return $customService->toArray(); } } \ No newline at end of file diff --git a/app/common/model/custom_service/CustomService.php b/app/common/model/custom_service/CustomService.php index 4a4151c71..b4cad227d 100644 --- a/app/common/model/custom_service/CustomService.php +++ b/app/common/model/custom_service/CustomService.php @@ -35,4 +35,14 @@ class CustomService extends BaseModel return empty($value) ? '' : date('Y-m-d H:i:s', $value); } + public function custom() + { + return $this->belongsTo(\app\common\model\custom\Custom::class, 'custom_id'); + } + + public function project() + { + return $this->belongsTo(\app\common\model\project\Project::class, 'project_id'); + } + } \ No newline at end of file