Я Создал GRUD.
Страница грузится очень долго.
Как оптимызуваты сапит чтобы грузило скорыше
Модель
Код: Выделить всё
<?php
namespace app\models;
use Yii;
class Report extends \yii\db\ActiveRecord
{
public static function tableName()
{
return 'table_test';
}
public function rules()
{
return [
[['date_s'], 'safe'],
[['status', 'lat', 'lng', 'speed', 'satellites'], 'required'],
[['lat', 'lng', 'speed'], 'number'],
[['satellites'], 'integer'],
[['status'], 'string', 'max' => 255],
];
}
public function attributeLabels()
{
return [
'id' => 'id',
'date_s' => 'Дата',
'status' => 'Статус',
'lat' => 'Ширина',
'lng' => 'Довгота',
'speed' => 'Швидкість',
'satellites' => 'Кіл-сть саталіти',
'name' => 'Відстань',
];
}
Код: Выделить всё
public function actionIndex()
{
$searchModel = new ReportSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
$dataProvider->pagination = ['pageSize' => 20];
return $this->render('index', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
]);
}