diff --git a/backend/controllers/AccountsVinController.php b/backend/controllers/AccountsVinController.php index 0ba507c..04e7689 100644 --- a/backend/controllers/AccountsVinController.php +++ b/backend/controllers/AccountsVinController.php @@ -13,7 +13,7 @@ use yii\filters\VerbFilter; * AccountsVinController implements the CRUD actions for AccountsVin model. */ class AccountsVinController extends Controller -{ +{ public $layout = "/column"; public function behaviors() { return [ diff --git a/backend/controllers/CheckPriceController.php b/backend/controllers/CheckPriceController.php index a5a13f9..3525ab3 100644 --- a/backend/controllers/CheckPriceController.php +++ b/backend/controllers/CheckPriceController.php @@ -8,7 +8,6 @@ use yii\filters\AccessControl; use backend\components\base\BaseController; use yii\filters\VerbFilter; use backend\models\Details; -use common\models\DetailsCurrency; use backend\models\ImportersFiles; use backend\models\Importers; use yii\base\ErrorException; @@ -62,7 +61,7 @@ class CheckPriceController extends BaseController public function actionIndex() { - + //$query = (new Query())->select('*')->from('{{%importer_files}}')->where(['not', ['time_end' => null]])->orderBy(['upload_time' => SORT_DESC]); $query = Importers::find()->where(['active' => true])->orderBy(['price_date_update' => SORT_DESC]); $provider = new ActiveDataProvider([ 'query' => $query, @@ -80,12 +79,11 @@ class CheckPriceController extends BaseController public function actionView ($id, $date_update) { - $query = DetailsCurrency::find()->where(['IMPORT_ID' => $id, 'timestamp' => $date_update])->limit(20); + $query = Details::find()->where(['IMPORT_ID' => $id, 'timestamp' => $date_update])->limit(20); - $importer = Importers::findOne( $id ); + $importer = Importers::findOne($id)->name; $date = Yii::$app->formatter->asDate( $date_update, 'yyyy-MM-dd' ); - $provider = new ActiveDataProvider([ 'query' => $query, 'pagination' => false, diff --git a/backend/controllers/DeliveriesController.php b/backend/controllers/DeliveriesController.php index 2a7e78b..8823d83 100644 --- a/backend/controllers/DeliveriesController.php +++ b/backend/controllers/DeliveriesController.php @@ -14,6 +14,8 @@ use yii\filters\VerbFilter; */ class DeliveriesController extends Controller { + + public $layout = "/column"; public function behaviors() { return [ diff --git a/backend/controllers/DicStatusesController.php b/backend/controllers/DicStatusesController.php index 6735515..2d993bc 100644 --- a/backend/controllers/DicStatusesController.php +++ b/backend/controllers/DicStatusesController.php @@ -14,6 +14,7 @@ use yii\filters\VerbFilter; */ class DicStatusesController extends Controller { + public $layout = "/column"; public function behaviors() { return [ diff --git a/backend/controllers/ManufacturersController.php b/backend/controllers/ManufacturersController.php index d0272d3..271e62a 100644 --- a/backend/controllers/ManufacturersController.php +++ b/backend/controllers/ManufacturersController.php @@ -14,6 +14,8 @@ use yii\filters\VerbFilter; */ class ManufacturersController extends Controller { + + public $layout = "/column"; public function behaviors() { return [ diff --git a/backend/models/Currency.php b/backend/models/Currency.php index fcb6570..819067c 100644 --- a/backend/models/Currency.php +++ b/backend/models/Currency.php @@ -15,6 +15,13 @@ use Yii; */ class Currency extends \yii\db\ActiveRecord { + /** + * @inheritdoc + */ + public static function tableName() + { + return 'w_currency'; + } /** * @inheritdoc diff --git a/backend/models/Importers.php b/backend/models/Importers.php index b07db1d..221b09e 100644 --- a/backend/models/Importers.php +++ b/backend/models/Importers.php @@ -5,7 +5,6 @@ namespace backend\models; use common\components\CustomVarDamp; use Yii; use backend\components\base\BaseActiveRecord; -use backend\models\Currency; /** * @@ -90,15 +89,6 @@ class Importers extends BaseActiveRecord ]; } - public function getCurrency () - { - return $this->hasOne(Currency::className(), ['id' => 'currency_id'])->one()->name; - } - - public function getCurrencyRate () - { - return $this->hasOne(Currency::className(), ['id' => 'currency_id'])->one()->rate; - } public function getKeys () { diff --git a/backend/views/art-history/index.php b/backend/views/art-history/index.php index 772bfb5..ab6800b 100644 --- a/backend/views/art-history/index.php +++ b/backend/views/art-history/index.php @@ -26,15 +26,17 @@ $this->params['breadcrumbs'][] = $this->title; 'filterModel' => $searchModel, 'columns' => [ ['class' => 'yii\grid\SerialColumn'], - 'user_id', [ 'attribute' => 'name', 'value' => 'name', ], 'art', - 'dt', - ['class' => 'yii\grid\ActionColumn'], + [ + 'attribute' => 'dt', + 'value' => 'date', + + ] ], ]); ?> diff --git a/backend/views/check-price/view.php b/backend/views/check-price/view.php index 9bcf7bd..680f946 100644 --- a/backend/views/check-price/view.php +++ b/backend/views/check-price/view.php @@ -8,29 +8,24 @@ use yii\bootstrap\Modal; /* @var $this yii\web\View */ /* @var $searchModel backend\models\CatalogSearch */ /* @var $dataProvider yii\data\ActiveDataProvider */ -$this->title = 'Прайс ' . Html::encode("{$importer->name} от {$date}"); +$this->title = 'Прайс ' . Html::encode( "{$importer} от {$date}" ); $this->params['breadcrumbs'][] = $this->title; ?> -
- -

title) ?>

- - $dataProvider, - 'columns' => [ - ['attribute' => 'FULL_ARTICLE'], - ['attribute' => 'ARTICLE'], - ['attribute' => 'BRAND'], - ['attribute' => 'DESCR'], - ['attribute' => 'BOX'], - ['attribute' => 'ADD_BOX'], - ['attribute' => 'GROUP'], - ['attribute' => 'name'], - ['attribute' => 'PRICE'], - ] - ] ); ?> - -
+
+ +

title) ?>

+ + $dataProvider, + + ] ); + + + ?> + + + +
\ No newline at end of file diff --git a/backend/views/dic-statuses/_form.php b/backend/views/dic-statuses/_form.php new file mode 100644 index 0000000..d941f74 --- /dev/null +++ b/backend/views/dic-statuses/_form.php @@ -0,0 +1,31 @@ + + +
+ + + + field($model, 'name')->textInput(['maxlength' => true]) ?> + + field($model, 'color')->textInput(['maxlength' => true]) ?> + + field($model, 'active')->textInput() ?> + + field($model, 'sort')->textInput() ?> + + field($model, 'if_mail')->textInput() ?> + +
+ isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?> +
+ + + +
diff --git a/backend/views/dic-statuses/_search.php b/backend/views/dic-statuses/_search.php new file mode 100644 index 0000000..7f3efb0 --- /dev/null +++ b/backend/views/dic-statuses/_search.php @@ -0,0 +1,37 @@ + + + diff --git a/backend/views/dic-statuses/create.php b/backend/views/dic-statuses/create.php new file mode 100644 index 0000000..2ecc6fe --- /dev/null +++ b/backend/views/dic-statuses/create.php @@ -0,0 +1,21 @@ +title = 'Create Dic Statuses'; +$this->params['breadcrumbs'][] = ['label' => 'Dic Statuses', 'url' => ['index']]; +$this->params['breadcrumbs'][] = $this->title; +?> +
+ +

title) ?>

+ + render('_form', [ + 'model' => $model, + ]) ?> + +
diff --git a/backend/views/dic-statuses/index.php b/backend/views/dic-statuses/index.php new file mode 100644 index 0000000..8e64942 --- /dev/null +++ b/backend/views/dic-statuses/index.php @@ -0,0 +1,39 @@ +title = 'Dic Statuses'; +$this->params['breadcrumbs'][] = $this->title; +?> +
+ +

title) ?>

+ render('_search', ['model' => $searchModel]); ?> + +

+ 'btn btn-success']) ?> +

+ + $dataProvider, + 'filterModel' => $searchModel, + 'columns' => [ + ['class' => 'yii\grid\SerialColumn'], + + 'id', + 'name', + 'color', + 'active', + 'sort', + // 'if_mail', + + ['class' => 'yii\grid\ActionColumn'], + ], + ]); ?> + +
diff --git a/backend/views/dic-statuses/update.php b/backend/views/dic-statuses/update.php new file mode 100644 index 0000000..7fc22dd --- /dev/null +++ b/backend/views/dic-statuses/update.php @@ -0,0 +1,21 @@ +title = 'Update Dic Statuses: ' . ' ' . $model->name; +$this->params['breadcrumbs'][] = ['label' => 'Dic Statuses', 'url' => ['index']]; +$this->params['breadcrumbs'][] = ['label' => $model->name, 'url' => ['view', 'id' => $model->id]]; +$this->params['breadcrumbs'][] = 'Update'; +?> +
+ +

title) ?>

+ + render('_form', [ + 'model' => $model, + ]) ?> + +
diff --git a/backend/views/dic-statuses/view.php b/backend/views/dic-statuses/view.php new file mode 100644 index 0000000..aa27d85 --- /dev/null +++ b/backend/views/dic-statuses/view.php @@ -0,0 +1,40 @@ +title = $model->name; +$this->params['breadcrumbs'][] = ['label' => 'Dic Statuses', 'url' => ['index']]; +$this->params['breadcrumbs'][] = $this->title; +?> +
+ +

title) ?>

+ +

+ $model->id], ['class' => 'btn btn-primary']) ?> + $model->id], [ + 'class' => 'btn btn-danger', + 'data' => [ + 'confirm' => 'Are you sure you want to delete this item?', + 'method' => 'post', + ], + ]) ?> +

+ + $model, + 'attributes' => [ + 'id', + 'name', + 'color', + 'active', + 'sort', + 'if_mail', + ], + ]) ?> + +
diff --git a/backend/views/dic_statuses/_form.php b/backend/views/dic_statuses/_form.php deleted file mode 100644 index d941f74..0000000 --- a/backend/views/dic_statuses/_form.php +++ /dev/null @@ -1,31 +0,0 @@ - - -
- - - - field($model, 'name')->textInput(['maxlength' => true]) ?> - - field($model, 'color')->textInput(['maxlength' => true]) ?> - - field($model, 'active')->textInput() ?> - - field($model, 'sort')->textInput() ?> - - field($model, 'if_mail')->textInput() ?> - -
- isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?> -
- - - -
diff --git a/backend/views/dic_statuses/_search.php b/backend/views/dic_statuses/_search.php deleted file mode 100644 index 7f3efb0..0000000 --- a/backend/views/dic_statuses/_search.php +++ /dev/null @@ -1,37 +0,0 @@ - - - diff --git a/backend/views/dic_statuses/create.php b/backend/views/dic_statuses/create.php deleted file mode 100644 index 2ecc6fe..0000000 --- a/backend/views/dic_statuses/create.php +++ /dev/null @@ -1,21 +0,0 @@ -title = 'Create Dic Statuses'; -$this->params['breadcrumbs'][] = ['label' => 'Dic Statuses', 'url' => ['index']]; -$this->params['breadcrumbs'][] = $this->title; -?> -
- -

title) ?>

- - render('_form', [ - 'model' => $model, - ]) ?> - -
diff --git a/backend/views/dic_statuses/index.php b/backend/views/dic_statuses/index.php deleted file mode 100644 index 8e64942..0000000 --- a/backend/views/dic_statuses/index.php +++ /dev/null @@ -1,39 +0,0 @@ -title = 'Dic Statuses'; -$this->params['breadcrumbs'][] = $this->title; -?> -
- -

title) ?>

- render('_search', ['model' => $searchModel]); ?> - -

- 'btn btn-success']) ?> -

- - $dataProvider, - 'filterModel' => $searchModel, - 'columns' => [ - ['class' => 'yii\grid\SerialColumn'], - - 'id', - 'name', - 'color', - 'active', - 'sort', - // 'if_mail', - - ['class' => 'yii\grid\ActionColumn'], - ], - ]); ?> - -
diff --git a/backend/views/dic_statuses/update.php b/backend/views/dic_statuses/update.php deleted file mode 100644 index 7fc22dd..0000000 --- a/backend/views/dic_statuses/update.php +++ /dev/null @@ -1,21 +0,0 @@ -title = 'Update Dic Statuses: ' . ' ' . $model->name; -$this->params['breadcrumbs'][] = ['label' => 'Dic Statuses', 'url' => ['index']]; -$this->params['breadcrumbs'][] = ['label' => $model->name, 'url' => ['view', 'id' => $model->id]]; -$this->params['breadcrumbs'][] = 'Update'; -?> -
- -

title) ?>

- - render('_form', [ - 'model' => $model, - ]) ?> - -
diff --git a/backend/views/dic_statuses/view.php b/backend/views/dic_statuses/view.php deleted file mode 100644 index aa27d85..0000000 --- a/backend/views/dic_statuses/view.php +++ /dev/null @@ -1,40 +0,0 @@ -title = $model->name; -$this->params['breadcrumbs'][] = ['label' => 'Dic Statuses', 'url' => ['index']]; -$this->params['breadcrumbs'][] = $this->title; -?> -
- -

title) ?>

- -

- $model->id], ['class' => 'btn btn-primary']) ?> - $model->id], [ - 'class' => 'btn btn-danger', - 'data' => [ - 'confirm' => 'Are you sure you want to delete this item?', - 'method' => 'post', - ], - ]) ?> -

- - $model, - 'attributes' => [ - 'id', - 'name', - 'color', - 'active', - 'sort', - 'if_mail', - ], - ]) ?> - -
diff --git a/common/components/parsers/CustomCsvParser.php b/common/components/parsers/CustomCsvParser.php index b21fbca..2f352a1 100644 --- a/common/components/parsers/CustomCsvParser.php +++ b/common/components/parsers/CustomCsvParser.php @@ -16,7 +16,7 @@ use yii\base\ErrorException; class CustomCsvParser extends \yii\multiparser\CsvParser { - public $last_line = 100; + public $last_line = 10; //public $hasHeaderRow = true; // public $keys = ['first','second', 'third', 'forth', 'fifth']; // public function setupConverter() diff --git a/common/models/ArtHistory.php b/common/models/ArtHistory.php index df536a7..c01bcac 100644 --- a/common/models/ArtHistory.php +++ b/common/models/ArtHistory.php @@ -15,7 +15,7 @@ use Yii; class ArtHistory extends \yii\db\ActiveRecord { - public $name; + /** * @inheritdoc */ @@ -32,7 +32,7 @@ class ArtHistory extends \yii\db\ActiveRecord return [ [['user_id', 'art', 'dt'], 'required'], [['user_id'], 'integer'], - [['art','name'], 'string', 'max' => 100], + [['art'], 'string', 'max' => 100], [['dt'], 'string', 'max' => 15], [['user_id', 'art'], 'unique', 'targetAttribute' => ['user_id', 'art'], 'message' => 'The combination of User ID and Art has already been taken.'] ]; @@ -53,12 +53,23 @@ class ArtHistory extends \yii\db\ActiveRecord } -// public function getAccounts() -// { -// return $this->hasOne(Accounts::className(), ['id' => 'user_id']); -// } + public function getAccounts() + { + return $this->hasOne(Accounts::className(), ['id' => 'user_id']); + } public function getName(){ - return $this->user_id.'11111111'; + if($this->accounts instanceof Accounts){ + return "№{$this->user_id}, {$this->accounts->name}"; + } else { + return "№{$this->user_id}"; + } + } + + public function getDate(){ + return date("Y-m-d H:i:s", $this->dt); + + } + } diff --git a/common/models/ArtHistorySearch.php b/common/models/ArtHistorySearch.php index 159e014..0376e60 100644 --- a/common/models/ArtHistorySearch.php +++ b/common/models/ArtHistorySearch.php @@ -12,7 +12,8 @@ use common\models\ArtHistory; */ class ArtHistorySearch extends ArtHistory { - + public $name; + public $date; /** * @inheritdoc */ @@ -20,7 +21,7 @@ class ArtHistorySearch extends ArtHistory { return [ [['id', 'user_id'], 'integer'], - [['art', 'dt', 'name'], 'safe'], + [['art', 'dt', 'name','date'], 'safe'], ]; } @@ -50,11 +51,11 @@ class ArtHistorySearch extends ArtHistory $dataProvider->setSort([ 'attributes' => [ 'id', - 'user_id', - 'art', 'dt', + 'art', 'name' => [ - 'default' => SORT_ASC + 'asc' => ['user_id' => SORT_ASC, Accounts::tableName().'.name' => SORT_ASC], + 'desc' => ['user_id' => SORT_DESC, Accounts::tableName().'.name' => SORT_DESC], ] ] ]); @@ -74,7 +75,7 @@ class ArtHistorySearch extends ArtHistory $query->andFilterWhere(['like', 'art', $this->art]) ->andFilterWhere(['like', 'dt', $this->dt]); - //$query->andFilterWhere(['like', Accounts::tableName().'.name', $this->name]); + $query->andFilterWhere(['like', Accounts::tableName().'.name', $this->name]); return $dataProvider; } } diff --git a/console/controllers/ParserController.php b/console/controllers/ParserController.php index c3090b8..0e26114 100644 --- a/console/controllers/ParserController.php +++ b/console/controllers/ParserController.php @@ -35,7 +35,8 @@ class ParserController extends Controller 'importer_id' => $importer_id, 'parser_config' => ['keys' => $keys, 'converter_conf' => - [ 'sign' => $sign, 'multiplier' => $multiplier, 'importer_id' => $importer_id ], + ['sign' => $sign, + 'multiplier' => $multiplier], 'mode' => 'console'] ]; if ($this->parseFileConsole($file_path, $config)) { diff --git a/console/migrations/m150925_111922_add_foreign_key_ImportFiles.php b/console/migrations/m150925_111922_add_foreign_key_ImportFiles.php index bb4a6af..0954d7f 100644 --- a/console/migrations/m150925_111922_add_foreign_key_ImportFiles.php +++ b/console/migrations/m150925_111922_add_foreign_key_ImportFiles.php @@ -22,7 +22,7 @@ class m150925_111922_add_foreign_key_ImportFiles extends Migration $this->addForeignKey('importer_fk', '{{%importers_files}}', 'importer_id', '{{%importers}}', 'id'); } - public function safeDown() + public function down() { $this->dropForeignKey('importer_fk', '{{%importers_files}}'); } diff --git a/frontend/views/site/BC2_catalog_zapchasti.php b/frontend/views/site/BC2_catalog_zapchasti.php index eac465b..ef3ca97 100644 --- a/frontend/views/site/BC2_catalog_zapchasti.php +++ b/frontend/views/site/BC2_catalog_zapchasti.php @@ -20,7 +20,7 @@ $this->params['breadcrumbs'][] = $this->title;
- +

Укажите свой автомобиль и мы предложим вам еще Аккумуляторы (АКБ)

@@ -198,7 +198,7 @@ $this->params['breadcrumbs'][] = $this->title; 12V 88Ah 740A - + li:first-child>a, .pagination>li:first-child>span { - border-top-left-radius: 20px; - border-bottom-left-radius: 20px; + border-top-left-radius: 20px!important; + border-bottom-left-radius: 20px!important; height: 24px; width: 24px; padding-top: 1px; @@ -97,8 +91,7 @@ p, a, label, span{ float: left; height: 24px; width: 24px; - padding-top: 1px; - padding-left: 7px; + padding: 1px 7px!important; margin-left: -1px; line-height: 1.42857143; color: #333; @@ -117,8 +110,14 @@ p, a, label, span{ } .pagination>li:last-child>a, .pagination>li:last-child>span { - border-top-right-radius: 20px; - border-bottom-right-radius: 20px; + border-top-right-radius: 20px!important; + border-bottom-right-radius: 20px!important; +} + +.pagination{ + display: table!important; + padding-top: 23px!important; + margin: 20px auto!important; } .choose_tovar a { @@ -154,7 +153,7 @@ p, a, label, span{ .back_news{ - background-image: url('../images/arrow_slider_back.png'); + background-image: url('/images/arrow_slider_back.png'); background-repeat: no-repeat; background-position: 0% 46%; position: relative; @@ -163,7 +162,7 @@ p, a, label, span{ } .next_news{ float: right; - background-image: url('../images/arrow_slider_go.png'); + background-image: url('/images/arrow_slider_go.png'); background-repeat: no-repeat; background-position: 100% 42%; position: relative; diff --git a/frontend/web/css/style/optovikam.css b/frontend/web/css/style/optovikam.css index 7ebcb98..a58f337 100644 --- a/frontend/web/css/style/optovikam.css +++ b/frontend/web/css/style/optovikam.css @@ -49,7 +49,7 @@ } .choose_tovar-list li{ padding-left: 13px; - background-image: url("../images/purple_eclipse.png"); + background-image: url("/images/purple_eclipse.png"); background-position: 2px 6px; background-repeat: no-repeat; diff --git a/frontend/web/css/style_vin.css b/frontend/web/css/style_vin.css index 3a345ea..cbf15b9 100644 --- a/frontend/web/css/style_vin.css +++ b/frontend/web/css/style_vin.css @@ -520,4 +520,10 @@ table a{ margin-left: 133px!important; color: #6b84b5; text-decoration: underline; +} + +.search_input .orange{ + float: right; + margin-top: 4px; + margin-right: 3px; } \ No newline at end of file diff --git a/frontend/web/js/script.js b/frontend/web/js/script.js index 8927204..ae38318 100644 --- a/frontend/web/js/script.js +++ b/frontend/web/js/script.js @@ -142,11 +142,11 @@ $('.phone_control, .phone_placeholder').click( $('#auto_staff').hover( function(){ - $('.dropdown_menu').stop().slideDown(500); + $('.dropdown_menu').stop().fadeIn(500); }, function(){ - $('.dropdown_menu').stop().slideUp(400); + $('.dropdown_menu').stop().fadeOut(400); // $('.dropdown_menu').delay(300).queue(function () { // $(this).css({display:'none'}); // $(this).dequeue();}); -- libgit2 0.21.4