payment step - bank transfer

This commit is contained in:
saparatayev 2021-07-16 17:38:27 +05:00
parent 2c0246cc98
commit 1f8ef61275
5 changed files with 42 additions and 1 deletions

View File

@ -311,12 +311,14 @@ class OfferForm extends ComponentBase
DB::transaction(function() use ($draft_offers, $newPaymentId) {
foreach($draft_offers as $df) {
$df->payment_id = $newPaymentId;
$draft_offers->status = 'new';
$df->status = 'new';
$df->save();
}
});
// attach file to payment
$newPayment->bank_file = Input::file('bank_file');
$newPayment->save();
return [
'#form-steps' => $this->renderPartial('@message')

View File

@ -33,4 +33,8 @@ class Payment extends Model
public $belongsTo = [
'user' => 'RainLab\User\Models\User'
];
public $attachOne = [
'bank_file' => 'System\Models\File'
];
}

View File

@ -37,3 +37,12 @@ fields:
size: ''
span: auto
type: textarea
bank_file:
label: 'Bank file'
mode: file
useCaption: true
thumbOptions:
mode: crop
extension: auto
span: auto
type: fileupload

View File

@ -0,0 +1,23 @@
<?php namespace TPS\Birzha\Updates;
use Schema;
use October\Rain\Database\Updates\Migration;
class BuilderTableUpdateTpsBirzhaPayments2 extends Migration
{
public function up()
{
Schema::table('tps_birzha_payments', function($table)
{
$table->text('bank_file')->nullable();
});
}
public function down()
{
Schema::table('tps_birzha_payments', function($table)
{
$table->dropColumn('bank_file');
});
}
}

View File

@ -152,3 +152,6 @@
1.0.52:
- 'Updated table tps_birzha_messages'
- builder_table_update_tps_birzha_messages_2.php
1.0.53:
- 'Updated table tps_birzha_payments'
- builder_table_update_tps_birzha_payments_2.php