From 9e0a360b331621013f0b9aee4f7e6ac482d89b50 Mon Sep 17 00:00:00 2001 From: omair saleh Date: Wed, 29 Dec 2021 02:11:26 +0800 Subject: [PATCH] fix create contract bug --- app/Http/Modules/User/ContractModule.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/Http/Modules/User/ContractModule.php b/app/Http/Modules/User/ContractModule.php index eb7fe74..5a83561 100644 --- a/app/Http/Modules/User/ContractModule.php +++ b/app/Http/Modules/User/ContractModule.php @@ -2,6 +2,7 @@ namespace App\Http\Modules\User; +use App\Models\ContractTemplateObligation; use Auth; use App\Models\Contract; use App\Models\ContractLog; @@ -133,16 +134,16 @@ class ContractModule extends BaseController ->get(); if (!empty($contract_template_obligation_dependency[0])) { - dd($contract_template_obligation_dependency[0]); $contract_obligation = ContractObligation:: where('contract_id', $contract->id) ->where('contract_template_obligation_id', $contract_template_obligation_dependency[0]->contract_template_obligation_id) ->first(); - $depend_contract_obligation = ContractObligation:: - where('contract_id', $contract->id) - ->where('contract_template_obligation_id', $contract_template_obligation_dependency[0]->depend_contract_template_obligation_id) + $depend_contract_obligation = ContractTemplateObligation:: + where('contract_template_id', $contarct_template->id) + ->where('id', $contract_template_obligation_dependency[0]->depend_contract_template_obligation_id) ->first(); + dd($depend_contract_obligation); $request->request->add([ 'contract_obligation_id' => [$contract_obligation->hash_id],