From a032cd52aa6f542d0b85ee6df0f3fcbcabb91293 Mon Sep 17 00:00:00 2001 From: Thekindbull Date: Wed, 18 Jun 2025 09:45:36 +0800 Subject: [PATCH] contract api updated --- .../Bitrix/ContractApiController.php | 3 +- app/Models/Deal/Contract.php | 3 +- ..._add_plan7_id_column_to_contract_table.php | 30 +++++++ .../views/clients/contract/index.blade.php | 78 ++++++++++++------- 4 files changed, 84 insertions(+), 30 deletions(-) create mode 100644 database/migrations/2025_06_18_095056_add_plan7_id_column_to_contract_table.php diff --git a/app/Http/Controllers/Bitrix/ContractApiController.php b/app/Http/Controllers/Bitrix/ContractApiController.php index bc0b4ef..5b99ccc 100644 --- a/app/Http/Controllers/Bitrix/ContractApiController.php +++ b/app/Http/Controllers/Bitrix/ContractApiController.php @@ -27,7 +27,8 @@ public function __invoke(Deal $deal, Request $request) 'room' => $request->room,//Номер квартиры 'date' => $request->date,//дата ДДУ 'reg_date' => $request->reg_date,//Дата регистрации ДДУ - 'payment_type' => $request->payment_type//Вид оплаты + 'payment_type' => $request->payment_type,//Вид оплаты + 'plan7_id' => $request->plan7_id ] ); $agent = $deal->agent; diff --git a/app/Models/Deal/Contract.php b/app/Models/Deal/Contract.php index b458696..208a2e0 100644 --- a/app/Models/Deal/Contract.php +++ b/app/Models/Deal/Contract.php @@ -23,7 +23,8 @@ class Contract extends Model 'room',//Номер квартиры 'date',//дата ДДУ 'reg_date',//Дата регистрации ДДУ - 'payment_type'//Вид оплаты + 'payment_type',//Вид оплаты + 'plan7_id'//ид помещения из plan7 ]; public function deal() diff --git a/database/migrations/2025_06_18_095056_add_plan7_id_column_to_contract_table.php b/database/migrations/2025_06_18_095056_add_plan7_id_column_to_contract_table.php new file mode 100644 index 0000000..daf95bc --- /dev/null +++ b/database/migrations/2025_06_18_095056_add_plan7_id_column_to_contract_table.php @@ -0,0 +1,30 @@ +integer('plan7_id')->nullable(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('client_contract', function (Blueprint $table) + { + // + }); + } +}; diff --git a/resources/views/clients/contract/index.blade.php b/resources/views/clients/contract/index.blade.php index 6059302..d17f5b3 100644 --- a/resources/views/clients/contract/index.blade.php +++ b/resources/views/clients/contract/index.blade.php @@ -5,19 +5,21 @@
-
+
ФИО
{{ $contract->deal->user->name }}
-
-
Email
-
{{ $contract->deal->user->email }}
-
-
+
Телефон
{{ $contract->deal->user->phone }}
-
+ @if ($contract->deal->user->email) +
+
Email
+
{{ $contract->deal->user->email }}
+
+ @endif +
-
Дата создания
+
Дата обновления
- {{ $contract->created_at->format('d.m.y H:i') }}
+ {{ $contract->updated_at->format('d.m.y H:i') }}
+
+
+
+
+
Площадь объекта
+
{{ $contract->square }}
+
+
+
Этаж
+
{{ $contract->floor }}
+
+
+
Помещение
+
{{ $contract->room }}
-
Площадь объекта
-
{{ $contract->square }}
+
Стоимость
+
+ {{ number_format($contract->price, 2, ',', ' ') }} +
+ {{ $contract->payment_type }} +
+
-
Этаж
-
{{ $contract->floor }}
+
Вознаграждение
+
+ {{ number_format($contract->reward, 2, ',', ' ') }}