From a4131da38ffd843508e51f900a880fa8cbead85e Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Wed, 13 Dec 2023 14:17:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=AE=A2=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/adminapi/logic/custom_follow/CustomFollowLogic.php | 4 +++- app/common/model/custom_follow/CustomFollow.php | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/adminapi/logic/custom_follow/CustomFollowLogic.php b/app/adminapi/logic/custom_follow/CustomFollowLogic.php index bafa2c5f8..225e50947 100644 --- a/app/adminapi/logic/custom_follow/CustomFollowLogic.php +++ b/app/adminapi/logic/custom_follow/CustomFollowLogic.php @@ -119,6 +119,8 @@ class CustomFollowLogic extends BaseLogic */ public static function detail($params): array { - return CustomFollow::findOrEmpty($params['id'])->toArray(); + $customFollow = CustomFollow::findOrEmpty($params['id']); + $customFollow->custom = $customFollow->custom; + return $customFollow->toArray(); } } \ No newline at end of file diff --git a/app/common/model/custom_follow/CustomFollow.php b/app/common/model/custom_follow/CustomFollow.php index db1f171b2..ef62a6001 100644 --- a/app/common/model/custom_follow/CustomFollow.php +++ b/app/common/model/custom_follow/CustomFollow.php @@ -40,5 +40,10 @@ class CustomFollow 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'); + } + } \ No newline at end of file