From d6633b6b36203f17e465e6d3037b5f3c687abeae Mon Sep 17 00:00:00 2001 From: chenbo <709206448@qq.com> Date: Thu, 29 Feb 2024 09:44:29 +0800 Subject: [PATCH] update --- .../project_process_management/ApplyWithSealLists.php | 2 +- .../project_process_management/ApplyWithSealLogic.php | 10 ++++------ .../model/project_process_management/ApplyWithSeal.php | 6 +++++- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/app/adminapi/lists/project_process_management/ApplyWithSealLists.php b/app/adminapi/lists/project_process_management/ApplyWithSealLists.php index 9127491f4..513479ee4 100644 --- a/app/adminapi/lists/project_process_management/ApplyWithSealLists.php +++ b/app/adminapi/lists/project_process_management/ApplyWithSealLists.php @@ -55,7 +55,7 @@ class ApplyWithSealLists extends BaseAdminDataLists implements ListsSearchInterf */ public function lists(): array { - return ApplyWithSeal::where($this->searchWhere) + return ApplyWithSeal::with(['projectInfo'])->where($this->searchWhere) ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) ->select() diff --git a/app/adminapi/logic/project_process_management/ApplyWithSealLogic.php b/app/adminapi/logic/project_process_management/ApplyWithSealLogic.php index 4e840a832..d2eb4f993 100644 --- a/app/adminapi/logic/project_process_management/ApplyWithSealLogic.php +++ b/app/adminapi/logic/project_process_management/ApplyWithSealLogic.php @@ -51,8 +51,7 @@ class ApplyWithSealLogic extends BaseLogic 'limit' => $params['limit'], 'depar' => $params['depar'], 'stampman' => $params['stampman'], - 'project' => $params['project'], - 'principal' => $params['principal'], + 'project_id' => $params['project_id'], 'content' => $params['content'], 'loan' => $params['loan'], 'borrow' => $params['borrow'], @@ -96,8 +95,7 @@ class ApplyWithSealLogic extends BaseLogic 'limit' => $params['limit'], 'depar' => $params['depar'], 'stampman' => $params['stampman'], - 'project' => $params['project'], - 'principal' => $params['principal'], + 'project_id' => $params['project_id'], 'content' => $params['content'], 'loan' => $params['loan'], 'borrow' => $params['borrow'], @@ -143,8 +141,8 @@ class ApplyWithSealLogic extends BaseLogic */ public static function detail($params): array { - $data = ApplyWithSeal::findOrEmpty($params['id'])->toArray(); - $data['annex'] = json_decode($params['annex'], true); + $data = ApplyWithSeal::with(['projectInfo'])->findOrEmpty($params['id'])->toArray(); + $data['annex'] = json_decode($data['annex'], true); return $data; } } \ No newline at end of file diff --git a/app/common/model/project_process_management/ApplyWithSeal.php b/app/common/model/project_process_management/ApplyWithSeal.php index 8bad52a94..1053b41ac 100644 --- a/app/common/model/project_process_management/ApplyWithSeal.php +++ b/app/common/model/project_process_management/ApplyWithSeal.php @@ -16,6 +16,7 @@ namespace app\common\model\project_process_management; use app\common\model\BaseModel; +use app\common\model\cost_project\CostProject; use think\model\concern\SoftDelete; @@ -30,5 +31,8 @@ class ApplyWithSeal extends BaseModel protected $name = 'apply_with_seal'; protected $deleteTime = 'delete_time'; - + public function projectInfo() + { + return $this->hasOne(CostProject::class, 'id', 'project_id'); + } } \ No newline at end of file