From 6aaa5b7ae13903e415044c24201b873cc3fad020 Mon Sep 17 00:00:00 2001 From: Mihail Date: Wed, 18 Nov 2015 11:37:18 +0200 Subject: [PATCH] work with check price functional --- .gitignore | 1 + backend/components/FieldEditor/FieldEditor.php | 43 ------------------------------------------- backend/components/FieldEditor/views/phone_field.php | 28 ---------------------------- backend/components/FieldEditor/views/video_field.php | 28 ---------------------------- backend/controllers/CheckPriceController.php | 3 ++- backend/models/ImportersCheckPriceSearch.php | 3 +++ backend/views/check-price/index.php | 1 + common/components/PriceWriter.php | 2 ++ common/components/parsers/config.php | 3 ++- storage/parser_data/manual/Групы VW.xlsx | Bin 0 -> 11481 bytes storage/parser_data/temp/xlsx/kud0hb7or3133ull44s061thg2/[Content_Types].xml | 2 ++ storage/parser_data/temp/xlsx/kud0hb7or3133ull44s061thg2/_rels/.rels | 2 ++ storage/parser_data/temp/xlsx/kud0hb7or3133ull44s061thg2/docProps/app.xml | 2 ++ storage/parser_data/temp/xlsx/kud0hb7or3133ull44s061thg2/docProps/core.xml | 2 ++ storage/parser_data/temp/xlsx/kud0hb7or3133ull44s061thg2/xl/_rels/workbook.xml.rels | 2 ++ storage/parser_data/temp/xlsx/kud0hb7or3133ull44s061thg2/xl/calcChain.xml | 2 ++ storage/parser_data/temp/xlsx/kud0hb7or3133ull44s061thg2/xl/printerSettings/printerSettings1.bin | Bin 0 -> 220 bytes storage/parser_data/temp/xlsx/kud0hb7or3133ull44s061thg2/xl/sharedStrings.xml | 2 ++ storage/parser_data/temp/xlsx/kud0hb7or3133ull44s061thg2/xl/styles.xml | 2 ++ storage/parser_data/temp/xlsx/kud0hb7or3133ull44s061thg2/xl/theme/theme1.xml | 2 ++ storage/parser_data/temp/xlsx/kud0hb7or3133ull44s061thg2/xl/workbook.xml | 2 ++ storage/parser_data/temp/xlsx/kud0hb7or3133ull44s061thg2/xl/worksheets/_rels/sheet1.xml.rels | 2 ++ storage/parser_data/temp/xlsx/kud0hb7or3133ull44s061thg2/xl/worksheets/sheet1.xml | 2 ++ storage/parser_data/temp/xlsx/kud0hb7or3133ull44s061thg2/xl/worksheets/sheet2.xml | 2 ++ storage/parser_data/temp/xlsx/kud0hb7or3133ull44s061thg2/xl/worksheets/sheet3.xml | 2 ++ 25 files changed, 39 insertions(+), 101 deletions(-) delete mode 100755 backend/components/FieldEditor/FieldEditor.php delete mode 100755 backend/components/FieldEditor/views/phone_field.php delete mode 100755 backend/components/FieldEditor/views/video_field.php create mode 100644 storage/parser_data/manual/Групы VW.xlsx create mode 100644 storage/parser_data/temp/xlsx/kud0hb7or3133ull44s061thg2/[Content_Types].xml create mode 100644 storage/parser_data/temp/xlsx/kud0hb7or3133ull44s061thg2/_rels/.rels create mode 100644 storage/parser_data/temp/xlsx/kud0hb7or3133ull44s061thg2/docProps/app.xml create mode 100644 storage/parser_data/temp/xlsx/kud0hb7or3133ull44s061thg2/docProps/core.xml create mode 100644 storage/parser_data/temp/xlsx/kud0hb7or3133ull44s061thg2/xl/_rels/workbook.xml.rels create mode 100644 storage/parser_data/temp/xlsx/kud0hb7or3133ull44s061thg2/xl/calcChain.xml create mode 100644 storage/parser_data/temp/xlsx/kud0hb7or3133ull44s061thg2/xl/printerSettings/printerSettings1.bin create mode 100644 storage/parser_data/temp/xlsx/kud0hb7or3133ull44s061thg2/xl/sharedStrings.xml create mode 100644 storage/parser_data/temp/xlsx/kud0hb7or3133ull44s061thg2/xl/styles.xml create mode 100644 storage/parser_data/temp/xlsx/kud0hb7or3133ull44s061thg2/xl/theme/theme1.xml create mode 100644 storage/parser_data/temp/xlsx/kud0hb7or3133ull44s061thg2/xl/workbook.xml create mode 100644 storage/parser_data/temp/xlsx/kud0hb7or3133ull44s061thg2/xl/worksheets/_rels/sheet1.xml.rels create mode 100644 storage/parser_data/temp/xlsx/kud0hb7or3133ull44s061thg2/xl/worksheets/sheet1.xml create mode 100644 storage/parser_data/temp/xlsx/kud0hb7or3133ull44s061thg2/xl/worksheets/sheet2.xml create mode 100644 storage/parser_data/temp/xlsx/kud0hb7or3133ull44s061thg2/xl/worksheets/sheet3.xml diff --git a/.gitignore b/.gitignore index fc56960..1804dac 100755 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ .idea /uploads /vendor +/storage tests/_output/* composer.lock \ No newline at end of file diff --git a/backend/components/FieldEditor/FieldEditor.php b/backend/components/FieldEditor/FieldEditor.php deleted file mode 100755 index 657e33d..0000000 --- a/backend/components/FieldEditor/FieldEditor.php +++ /dev/null @@ -1,43 +0,0 @@ -name && $this->brand && $this->model){ - $widgetData = $this->findModel(); - } else { - $widgetData= [new DetailsCriteria()]; - } - - - return $this->render($this->template.'_field',['model'=>$widgetData]); - } - - protected function findModel() - { - if (($model = DetailsCriteria::find()->where(['name'=>$this->name, 'brand'=>$this->brand])->all()) !== null) { - - return $model; - - } else { - return [new DetailsCriteria()]; - } - } -} \ No newline at end of file diff --git a/backend/components/FieldEditor/views/phone_field.php b/backend/components/FieldEditor/views/phone_field.php deleted file mode 100755 index 28078ff..0000000 --- a/backend/components/FieldEditor/views/phone_field.php +++ /dev/null @@ -1,28 +0,0 @@ - -
- - 'form-group'])?> - - - - -
-

Добавить поле

- - - \ No newline at end of file diff --git a/backend/components/FieldEditor/views/video_field.php b/backend/components/FieldEditor/views/video_field.php deleted file mode 100755 index 769b608..0000000 --- a/backend/components/FieldEditor/views/video_field.php +++ /dev/null @@ -1,28 +0,0 @@ - -
- - 'form-group'])?> - - - - -
-

Добавить поле

- - - \ No newline at end of file diff --git a/backend/controllers/CheckPriceController.php b/backend/controllers/CheckPriceController.php index 40b30eb..03222a6 100755 --- a/backend/controllers/CheckPriceController.php +++ b/backend/controllers/CheckPriceController.php @@ -18,6 +18,7 @@ use yii\base\ErrorException; use common\components\CustomVarDamp; use yii\web\GoneHttpException; use yii\web\HttpException; +use yii\web\NotFoundHttpException; /** * Parser controller @@ -110,7 +111,7 @@ class CheckPriceController extends BaseController return $this->redirect('index'); } else { - throw new HttpException('не удалось удалить прайс из базы данных'); + throw new NotFoundHttpException('не удалось удалить прайс из базы данных'); } diff --git a/backend/models/ImportersCheckPriceSearch.php b/backend/models/ImportersCheckPriceSearch.php index 659035e..b36daf4 100644 --- a/backend/models/ImportersCheckPriceSearch.php +++ b/backend/models/ImportersCheckPriceSearch.php @@ -23,6 +23,7 @@ class ImportersCheckPriceSearch extends Importers return [ [['price_date_update', 'date_to'], 'string', 'max' => 10], + [ 'id', 'integer'], ]; @@ -63,6 +64,8 @@ class ImportersCheckPriceSearch extends Importers // $query->where('0=1'); return $provider; } + $query->andFilterWhere([ + 'id' => $this->id]); if( $this->price_date_update != null || $this->date_to != null ){ diff --git a/backend/views/check-price/index.php b/backend/views/check-price/index.php index 33fadb1..4ea4d10 100755 --- a/backend/views/check-price/index.php +++ b/backend/views/check-price/index.php @@ -39,6 +39,7 @@ Pjax::begin(['id' => 'gridViewContent']); [ 'label' => 'Поставщик', + 'attribute' => 'id', 'value' => function ($data) { return '№ ' . $data->id . ' ' . $data->name; }, diff --git a/common/components/PriceWriter.php b/common/components/PriceWriter.php index 375682e..434fd9c 100755 --- a/common/components/PriceWriter.php +++ b/common/components/PriceWriter.php @@ -204,6 +204,8 @@ class PriceWriter $transaction->rollBack(); throw new \ErrorException($e->getMessage()); } + + return true; } } \ No newline at end of file diff --git a/common/components/parsers/config.php b/common/components/parsers/config.php index 3d611ab..909b397 100755 --- a/common/components/parsers/config.php +++ b/common/components/parsers/config.php @@ -72,7 +72,8 @@ ['web' => ['class' => 'yii\multiparser\XlsxParser', 'path_for_extract_files' => \Yii::getAlias('@temp_upload') . '/xlsx/', - // 'has_header_row' => true, + //'auto_detect_first_line' => true, + 'has_header_row' => true, 'active_sheet' => 1, 'converter_conf' => [ 'class' => 'common\components\parsers\CustomConverter', diff --git a/storage/parser_data/manual/Групы VW.xlsx b/storage/parser_data/manual/Групы VW.xlsx new file mode 100644 index 0000000..754c4e9 Binary files /dev/null and b/storage/parser_data/manual/Групы VW.xlsx differ diff --git a/storage/parser_data/temp/xlsx/kud0hb7or3133ull44s061thg2/[Content_Types].xml b/storage/parser_data/temp/xlsx/kud0hb7or3133ull44s061thg2/[Content_Types].xml new file mode 100644 index 0000000..ed02666 --- /dev/null +++ b/storage/parser_data/temp/xlsx/kud0hb7or3133ull44s061thg2/[Content_Types].xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/storage/parser_data/temp/xlsx/kud0hb7or3133ull44s061thg2/_rels/.rels b/storage/parser_data/temp/xlsx/kud0hb7or3133ull44s061thg2/_rels/.rels new file mode 100644 index 0000000..74bfd8d --- /dev/null +++ b/storage/parser_data/temp/xlsx/kud0hb7or3133ull44s061thg2/_rels/.rels @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/storage/parser_data/temp/xlsx/kud0hb7or3133ull44s061thg2/docProps/app.xml b/storage/parser_data/temp/xlsx/kud0hb7or3133ull44s061thg2/docProps/app.xml new file mode 100644 index 0000000..04952bd --- /dev/null +++ b/storage/parser_data/temp/xlsx/kud0hb7or3133ull44s061thg2/docProps/app.xml @@ -0,0 +1,2 @@ + +Microsoft Excel0falseЛисты3Лист1Лист2Лист3falsefalsefalse15.0300 \ No newline at end of file diff --git a/storage/parser_data/temp/xlsx/kud0hb7or3133ull44s061thg2/docProps/core.xml b/storage/parser_data/temp/xlsx/kud0hb7or3133ull44s061thg2/docProps/core.xml new file mode 100644 index 0000000..fd5f518 --- /dev/null +++ b/storage/parser_data/temp/xlsx/kud0hb7or3133ull44s061thg2/docProps/core.xml @@ -0,0 +1,2 @@ + +2006-09-16T00:00:00Z2015-11-17T15:57:37Z \ No newline at end of file diff --git a/storage/parser_data/temp/xlsx/kud0hb7or3133ull44s061thg2/xl/_rels/workbook.xml.rels b/storage/parser_data/temp/xlsx/kud0hb7or3133ull44s061thg2/xl/_rels/workbook.xml.rels new file mode 100644 index 0000000..b6fc24b --- /dev/null +++ b/storage/parser_data/temp/xlsx/kud0hb7or3133ull44s061thg2/xl/_rels/workbook.xml.rels @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/storage/parser_data/temp/xlsx/kud0hb7or3133ull44s061thg2/xl/calcChain.xml b/storage/parser_data/temp/xlsx/kud0hb7or3133ull44s061thg2/xl/calcChain.xml new file mode 100644 index 0000000..f967f01 --- /dev/null +++ b/storage/parser_data/temp/xlsx/kud0hb7or3133ull44s061thg2/xl/calcChain.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/storage/parser_data/temp/xlsx/kud0hb7or3133ull44s061thg2/xl/printerSettings/printerSettings1.bin b/storage/parser_data/temp/xlsx/kud0hb7or3133ull44s061thg2/xl/printerSettings/printerSettings1.bin new file mode 100644 index 0000000..e09f1c6 Binary files /dev/null and b/storage/parser_data/temp/xlsx/kud0hb7or3133ull44s061thg2/xl/printerSettings/printerSettings1.bin differ diff --git a/storage/parser_data/temp/xlsx/kud0hb7or3133ull44s061thg2/xl/sharedStrings.xml b/storage/parser_data/temp/xlsx/kud0hb7or3133ull44s061thg2/xl/sharedStrings.xml new file mode 100644 index 0000000..c3e9834 --- /dev/null +++ b/storage/parser_data/temp/xlsx/kud0hb7or3133ull44s061thg2/xl/sharedStrings.xml @@ -0,0 +1,2 @@ + +RGВХМ опт Опт ДилерКоеф. РозницаРозница Результат \ No newline at end of file diff --git a/storage/parser_data/temp/xlsx/kud0hb7or3133ull44s061thg2/xl/styles.xml b/storage/parser_data/temp/xlsx/kud0hb7or3133ull44s061thg2/xl/styles.xml new file mode 100644 index 0000000..eff67f3 --- /dev/null +++ b/storage/parser_data/temp/xlsx/kud0hb7or3133ull44s061thg2/xl/styles.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/storage/parser_data/temp/xlsx/kud0hb7or3133ull44s061thg2/xl/theme/theme1.xml b/storage/parser_data/temp/xlsx/kud0hb7or3133ull44s061thg2/xl/theme/theme1.xml new file mode 100644 index 0000000..87ebb9c --- /dev/null +++ b/storage/parser_data/temp/xlsx/kud0hb7or3133ull44s061thg2/xl/theme/theme1.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/storage/parser_data/temp/xlsx/kud0hb7or3133ull44s061thg2/xl/workbook.xml b/storage/parser_data/temp/xlsx/kud0hb7or3133ull44s061thg2/xl/workbook.xml new file mode 100644 index 0000000..10ce270 --- /dev/null +++ b/storage/parser_data/temp/xlsx/kud0hb7or3133ull44s061thg2/xl/workbook.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/storage/parser_data/temp/xlsx/kud0hb7or3133ull44s061thg2/xl/worksheets/_rels/sheet1.xml.rels b/storage/parser_data/temp/xlsx/kud0hb7or3133ull44s061thg2/xl/worksheets/_rels/sheet1.xml.rels new file mode 100644 index 0000000..5a9ac71 --- /dev/null +++ b/storage/parser_data/temp/xlsx/kud0hb7or3133ull44s061thg2/xl/worksheets/_rels/sheet1.xml.rels @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/storage/parser_data/temp/xlsx/kud0hb7or3133ull44s061thg2/xl/worksheets/sheet1.xml b/storage/parser_data/temp/xlsx/kud0hb7or3133ull44s061thg2/xl/worksheets/sheet1.xml new file mode 100644 index 0000000..a4b534e --- /dev/null +++ b/storage/parser_data/temp/xlsx/kud0hb7or3133ull44s061thg2/xl/worksheets/sheet1.xml @@ -0,0 +1,2 @@ + +012345610.572000000000000061.35B2*F20.7722000000000001120.661.35B3*F30.8910000000000001330.7481.351.009840.825000000000000071.351.113750000000000250.929499999999999991.351.254825000000000160.973500000000000141.351.314225000000000270.973500000000000141.351.314225000000000280.995500000000000161.351.3439250000000003 \ No newline at end of file diff --git a/storage/parser_data/temp/xlsx/kud0hb7or3133ull44s061thg2/xl/worksheets/sheet2.xml b/storage/parser_data/temp/xlsx/kud0hb7or3133ull44s061thg2/xl/worksheets/sheet2.xml new file mode 100644 index 0000000..60000cb --- /dev/null +++ b/storage/parser_data/temp/xlsx/kud0hb7or3133ull44s061thg2/xl/worksheets/sheet2.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/storage/parser_data/temp/xlsx/kud0hb7or3133ull44s061thg2/xl/worksheets/sheet3.xml b/storage/parser_data/temp/xlsx/kud0hb7or3133ull44s061thg2/xl/worksheets/sheet3.xml new file mode 100644 index 0000000..60000cb --- /dev/null +++ b/storage/parser_data/temp/xlsx/kud0hb7or3133ull44s061thg2/xl/worksheets/sheet3.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file -- libgit2 0.21.4