From 11988d61cabfdea05edeadec5a398733713cabad Mon Sep 17 00:00:00 2001 From: Amanmyrat Date: Fri, 4 Aug 2023 14:18:16 +0500 Subject: [PATCH] Fix zip file extraction --- plugins/tps/shops/controllers/Report.php | 4 ++-- plugins/tps/shops/models/ReportDetail.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/tps/shops/controllers/Report.php b/plugins/tps/shops/controllers/Report.php index d74f5e3..e5885cd 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; - // on local explode storage\app on live server storage/app - $report_detail->file = explode('storage/app', $storageDestinationPath)[1].'/'.$item; + // on local explode storage\app on live server storage/app + $report_detail->file = '/extract'.explode('extract', $storageDestinationPath)[1].'/'.$item; $report_detail->save(); Log::info("saved succesfully"); }else { diff --git a/plugins/tps/shops/models/ReportDetail.php b/plugins/tps/shops/models/ReportDetail.php index 9163c57..853b9ea 100755 --- a/plugins/tps/shops/models/ReportDetail.php +++ b/plugins/tps/shops/models/ReportDetail.php @@ -36,10 +36,10 @@ class ReportDetail extends Model ]; public function getShopFieldAttribute() { - return $this->shop->name; + return $this->shop != null ? $this->shop->name : ''; } public function getReportFieldAttribute() { - return $this->report->name; + return $this->report != null ? $this->report->name : ''; } }