From 67b594899a41bb82d211c522b8d2cf03113acef9 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 4 Aug 2023 09:06:37 +0000 Subject: [PATCH] Server push fixed report saving on server --- plugins/tps/shops/controllers/Report.php | 4 ++-- plugins/tps/shops/models/report/fields.yaml | 4 ++-- ...builder_table_update_tps_shops_reports.php | 23 +++++++++++++++++++ plugins/tps/shops/updates/version.yaml | 3 +++ 4 files changed, 30 insertions(+), 4 deletions(-) create mode 100644 plugins/tps/shops/updates/builder_table_update_tps_shops_reports.php diff --git a/plugins/tps/shops/controllers/Report.php b/plugins/tps/shops/controllers/Report.php index 8eea3b3..d74f5e3 100755 --- a/plugins/tps/shops/controllers/Report.php +++ b/plugins/tps/shops/controllers/Report.php @@ -50,8 +50,8 @@ class Report extends Controller $report_detail = new ReportDetail(); $report_detail->report_id = $id; $report_detail->shop_id = $shop->id; - $report_detail->file = explode('storage\app', $storageDestinationPath)[1].'/'.$item; - Log::info(explode('storage\app', $storageDestinationPath)[1].'/'.$item); + // on local explode storage\app on live server storage/app + $report_detail->file = explode('storage/app', $storageDestinationPath)[1].'/'.$item; $report_detail->save(); Log::info("saved succesfully"); }else { diff --git a/plugins/tps/shops/models/report/fields.yaml b/plugins/tps/shops/models/report/fields.yaml index e479fc3..f3f44f0 100755 --- a/plugins/tps/shops/models/report/fields.yaml +++ b/plugins/tps/shops/models/report/fields.yaml @@ -10,11 +10,11 @@ fields: type: text file: label: File - span: auto mode: file + fileTypes: 'zip,rar' useCaption: true thumbOptions: mode: crop extension: auto - fileTypes: 'zip,rar' + span: auto type: fileupload diff --git a/plugins/tps/shops/updates/builder_table_update_tps_shops_reports.php b/plugins/tps/shops/updates/builder_table_update_tps_shops_reports.php new file mode 100644 index 0000000..230065a --- /dev/null +++ b/plugins/tps/shops/updates/builder_table_update_tps_shops_reports.php @@ -0,0 +1,23 @@ +dropColumn('file'); + }); + } + + public function down() + { + Schema::table('tps_shops_reports', function($table) + { + $table->text('file'); + }); + } +} diff --git a/plugins/tps/shops/updates/version.yaml b/plugins/tps/shops/updates/version.yaml index ffc0e21..9066d95 100755 --- a/plugins/tps/shops/updates/version.yaml +++ b/plugins/tps/shops/updates/version.yaml @@ -81,3 +81,6 @@ 1.0.28: - 'Updated table tps_shops_sales' - builder_table_update_tps_shops_sales_2.php +1.0.29: + - 'Updated table tps_shops_reports' + - builder_table_update_tps_shops_reports.php