diff --git a/backend/controllers/DetailsDescriptionController.php b/backend/controllers/DetailsDescriptionController.php index 3214249..7a4a839 100644 --- a/backend/controllers/DetailsDescriptionController.php +++ b/backend/controllers/DetailsDescriptionController.php @@ -2,10 +2,12 @@ namespace backend\controllers; +use common\models\DetailsCriteria; use Yii; use common\models\DetailsDescription; use common\models\DetailsDescriptionSearch; use backend\components\base\BaseController; +use yii\data\ActiveDataProvider; use yii\web\NotFoundHttpException; use yii\filters\VerbFilter; @@ -51,8 +53,19 @@ class DetailsDescriptionController extends BaseController */ public function actionView($name, $brand) { + $criteria_model = new DetailsCriteria(); + $query = DetailsCriteria::find()->where(['name' => $name, 'brand' => $brand]); + + $dataProvider = new ActiveDataProvider([ + 'query' => $query, + 'pagination' => false, + ]); + + return $this->render('view', [ 'model' => $this->findModel($name, $brand), + 'criteria_model' => $criteria_model, + 'dataProvider' => $dataProvider, ]); } @@ -72,4 +85,6 @@ class DetailsDescriptionController extends BaseController throw new NotFoundHttpException('The requested page does not exist.'); } } + + } diff --git a/backend/models/ImportersCheckPriceSearch.php b/backend/models/ImportersCheckPriceSearch.php index 8c2b626..f346756 100644 --- a/backend/models/ImportersCheckPriceSearch.php +++ b/backend/models/ImportersCheckPriceSearch.php @@ -47,7 +47,8 @@ class ImportersCheckPriceSearch extends Importers public function search($params) { - $query = Importers::find()->where(['active' => true])->orderBy(['price_date_update' => SORT_DESC]); + //$query = Importers::find()->where(['active' => true])->orderBy(['price_date_update' => SORT_DESC]); + $query = Importers::find(); $provider = new ActiveDataProvider([ 'query' => $query, 'pagination' => [ @@ -64,7 +65,7 @@ class ImportersCheckPriceSearch extends Importers return $provider; } - if($this->price_date_update !== null || $this->date_to !== null){ + if( $this->price_date_update != null || $this->date_to != null ){ $date_from = mktime(0,0,0,(int)substr($this->price_date_update,4,2),(int)substr($this->price_date_update,1,2),(int)substr($this->price_date_update,7,4)); $date_to = mktime(23,59,59,(int)substr($this->date_to,4,2),(int)substr($this->date_to,1,2),(int)substr($this->date_to,7,4)); diff --git a/backend/views/details-description/view.php b/backend/views/details-description/view.php index b9e1e67..246388a 100644 --- a/backend/views/details-description/view.php +++ b/backend/views/details-description/view.php @@ -2,6 +2,9 @@ use yii\helpers\Html; use yii\widgets\DetailView; +use yii\widgets\ActiveForm; +use yii\grid\GridView; + /* @var $this yii\web\View */ /* @var $model common\models\DetailsDescription */ @@ -32,8 +35,31 @@ $this->params['breadcrumbs'][] = $this->title; ], ]) ?> -
+ + = GridView::widget([ + 'dataProvider' => $dataProvider, + 'columns' => [ + ['class' => 'yii\grid\SerialColumn'], + 'key', + 'value', + ['class' => 'yii\grid\ActionColumn', + 'template' => '{delete}'], + ], + ]); ?> + +