From 52b4ea0d4d6de4d8c9ae39bb7390f3a47a39b98b Mon Sep 17 00:00:00 2001 From: chenbo <709206448@qq.com> Date: Wed, 18 Oct 2023 10:26:34 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A2=AB=E5=86=B2=E6=8E=89=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/logic/CompanyLogic.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/app/common/logic/CompanyLogic.php b/app/common/logic/CompanyLogic.php index 557790006..e33dd5140 100644 --- a/app/common/logic/CompanyLogic.php +++ b/app/common/logic/CompanyLogic.php @@ -430,4 +430,17 @@ class CompanyLogic extends BaseLogic { return Company::field(['id', 'company_name', 'province', 'city', 'area', 'street', 'village', 'brigade'])->select()->toArray(); } + + public static function getPartyA($companyId) + { + $company = Company::where(['id' => $companyId])->find(); + $contract = Contract::where(['party_b'=>$company['id']])->find(); + if ($contract) { + $partyA = Company::where(['id'=>$contract['party_a']])->find()->toArray(); + return $partyA; + } else { + self::setError("该公司未与上级公司签约,无法充值押金"); + return false; + } + } }