diff --git a/plugins/tps/shops/controllers/Report.php b/plugins/tps/shops/controllers/Report.php index 2508140..8fe79b4 100755 --- a/plugins/tps/shops/controllers/Report.php +++ b/plugins/tps/shops/controllers/Report.php @@ -41,9 +41,9 @@ class Report extends Controller $filenames = array_diff(scandir($storageDestinationPath), array('.', '..')); foreach ($filenames as $item) { - $shop_number = explode(".", $item)[0]; -Log::info($item); - $shop = Shop::where("shop_number", $shop_number)->get()->first(); + $shop_id = explode(".", $item)[0]; + + $shop = Shop::where("shop_id", $shop_id)->get()->first(); if ($shop) { $exist = ReportDetail::where('report_id', $id)->where("shop_id", $shop->id)->get(); @@ -52,7 +52,6 @@ Log::info($item); $report_detail->report_id = $id; $report_detail->shop_id = $shop->id; // on local explode storage\app on live server storage/app -Log::info('/extract'.explode('extract', $storageDestinationPath)[1].'/'.$item); $report_detail->file = '/extract'.explode('extract', $storageDestinationPath)[1].'/'.$item; $report_detail->save(); Log::info("saved succesfully"); diff --git a/plugins/tps/shops/models/shop/columns.yaml b/plugins/tps/shops/models/shop/columns.yaml index 9ee9a1d..bc5f99e 100755 --- a/plugins/tps/shops/models/shop/columns.yaml +++ b/plugins/tps/shops/models/shop/columns.yaml @@ -8,6 +8,9 @@ columns: shop_number: label: shop_number type: text + shop_id: + label: shop_id + type: text phone: label: phone type: number @@ -19,7 +22,6 @@ columns: type: text category_field: label: category - disabled: true created_at: label: created_at type: datetime diff --git a/plugins/tps/shops/models/shop/fields.yaml b/plugins/tps/shops/models/shop/fields.yaml index ecf0f8c..9f7ac8f 100755 --- a/plugins/tps/shops/models/shop/fields.yaml +++ b/plugins/tps/shops/models/shop/fields.yaml @@ -15,6 +15,10 @@ fields: descriptionFrom: name span: auto type: relation + shop_id: + label: 'Shop Id' + span: auto + type: text floor: label: Floor span: auto diff --git a/plugins/tps/shops/updates/builder_table_update_tps_shops__12.php b/plugins/tps/shops/updates/builder_table_update_tps_shops__12.php new file mode 100644 index 0000000..f815850 --- /dev/null +++ b/plugins/tps/shops/updates/builder_table_update_tps_shops__12.php @@ -0,0 +1,23 @@ +string('shop_id')->nullable(); + }); + } + + public function down() + { + Schema::table('tps_shops_', function($table) + { + $table->dropColumn('shop_id'); + }); + } +} diff --git a/plugins/tps/shops/updates/version.yaml b/plugins/tps/shops/updates/version.yaml index 9066d95..5bc20c2 100755 --- a/plugins/tps/shops/updates/version.yaml +++ b/plugins/tps/shops/updates/version.yaml @@ -84,3 +84,6 @@ 1.0.29: - 'Updated table tps_shops_reports' - builder_table_update_tps_shops_reports.php +1.0.30: + - 'Updated table tps_shops_' + - builder_table_update_tps_shops__12.php