<?= // Tagging support Single
$form->field($model, 'description')->widget(Select2::classname(),[
'name' => 'color_3',
'value' => $model->description,
'data' =>$data,
'options' => ['placeholder' => 'Select a color ...'],
'pluginOptions' => [
'tags' => true,
'tokenSeparators' => [',', ' '],
'maximumInputLength' => 10
],
])->label(false) ?>
$dataProvider = new ActiveDataProvider([
'query' => \app\models\Zakaz::find()
->where('action <= 0') ->andWhere(['>=', 'data', strtotime('2017-04-01 00:00:00')])->andWhere(['<=', 'data', strtotime('2018-08-01 23:59:59')]),
'pagination' => [
'pageSize' => 10,
],
]);
->andWhere(['>=', 'data', strtotime('2017-04-01 00:00:00')])
->where('action <= 0')
->andWhere( 'data >= DATE_SUB(CURRENT_DATE, INTERVAL 7 DAY)'),
изменяя значение интервала. $dataProvider = new ActiveDataProvider([
'query' => \app\models\Zakaz::find(
->where('action <= 0') ->andWhere( 'date >= 2018-04-01 AND date <= 2018-08-01')
/* ->groupBy('date_close')*/,
'pagination' => [
'pageSize' => 20,
],
]);
frontend/config/main.php
<?
use \kartik\datecontrol\Module;
$params = array_merge(
require(__DIR__ . '/../../common/config/params.php'),
require(__DIR__ . '/../../common/config/params-local.php'),
require(__DIR__ . '/params.php'),
require(__DIR__ . '/params-local.php')
);
return [
'id' => 'app-frontend',
'basePath' => dirname(__DIR__),
'bootstrap' => ['log'],
'controllerNamespace' => 'frontend\controllers',
'modules' => [
'gridview' => ['class' => '\kartik\grid\Module'],
'datecontrol' => [
'class' => '\kartik\datecontrol\Module',
'displaySettings' => [
Module::FORMAT_DATE => 'dd-MM-yyyy',
Module::FORMAT_TIME => 'hh:mm:ss a',
Module::FORMAT_DATETIME => 'dd-MM-yyyy hh:mm:ss a',
],
'saveSettings' => [
Module::FORMAT_DATE => 'php:U', // saves as unix timestamp
Module::FORMAT_TIME => 'php:H:i:s',
Module::FORMAT_DATETIME => 'php:Y-m-d H:i:s',
],
],
],
'components' => [
'request' => [
'csrfParam' => '_csrf-frontend',
],
'user' => [
'identityClass' => 'common\models\User',
'enableAutoLogin' => true,
'identityCookie' => ['name' => '_identity-frontend', 'httpOnly' => true],
],
'session' => [
// this is the name of the session cookie used for login on the frontend
'name' => 'advanced-frontend',
],
'log' => [
'traceLevel' => YII_DEBUG ? 3 : 0,
'targets' => [
[
'class' => 'yii\log\FileTarget',
'levels' => ['error', 'warning'],
],
],
],
'bot' => [
'class' => 'frontend\components\TelegramComponent',
'apiToken' => '411890271:AAGOEkFv8aZSMnNNMK2qmKG5X94Cr4JtxS8',
],
'errorHandler' => [
'errorAction' => 'site/error',
],
'urlManager' => [
'enablePrettyUrl' => true,
'showScriptName' => false,
'rules' => [
'admin' => 'zakaz/admin',
'view/<id:\d+>' => 'zakaz/view',
'disain' => 'zakaz/disain',
'master' => 'zakaz/master',
'shop' => 'zakaz/shop',
'courier' => 'courier/index',
'todoist' => 'todoist/index',
'helpdesk' => 'helpdesk/index',
'custom' => 'custom/index',
'versia' => 'zakaz/index',
'create' => 'zakaz/create',
'update/<id:\d+>' => 'zakaz/update',
'login' => 'site/login',
'logout' => 'site/logout',
'createzakaz/<id_zakaz:\d+>' => 'todoist/createzakaz',
'view-todoist/<id:\d+>' => 'todoist/view',
],
],
],
'params' => $params,
];
server {
charset utf-8;
client_max_body_size 128M;
listen 80; ## listen for ipv4
#listen [::]:80 default_server ipv6only=on; ## слушаем ipv6
server_name mysite.test;
#root /var/www/yii/crm_2.3/backend/web;
root /var/www/yii/crm_2.3/frontend/web;
#root /var/www/yii/crm/backend/web;
index index.php;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
location / {
# Перенаправляем все запросы к несуществующим директориям и файлам на index.php
try_files $uri $uri/ /index.php?$args;
}
# раскомментируйте строки ниже во избежание обработки Yii обращений к несуществующим статическим файлам
location ~ \.(js|css|png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar)$ {
try_files $uri =404;
access_log off;
log_not_found off;
expires off;
}
#error_page 404 /404.html;
location ~ \.php$ {
include fastcgi_params;
#fastcgi_pass 127.0.0.1:9000;
#fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_pass unix:/run/php/php5.6-fpm.sock;
fastcgi_read_timeout 3000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_buffers 16 16k;
fastcgi_buffer_size 32k;
}
location ~ /\.(ht|svn|git) {
access_log off;
log_not_found off;
deny all;
}
}
2018/07/22 18:44:04 [error] 16707#16707: *1 FastCGI sent in stderr: "PHP message: PHP Warning: Invalid argument supplied for foreach() in /var/www/yii/crm_2.3/vendor/yiisoft/yii2/helpers/BaseArrayHelper.php on line 123
PHP message: PHP Fatal error: Uncaught yii\base\InvalidConfigException: The "id" configuration for the Application is required. in /var/www/yii/crm_2.3/vendor/yiisoft/yii2/base/Application.php:219
Stack trace:
#0 /var/www/yii/crm_2.3/vendor/yiisoft/yii2/base/Application.php(201): yii\base\Application->preInit(Array)
#1 /var/www/yii/crm_2.3/frontend/web/index.php(17): yii\base\Application->__construct(Array)
#2 {main}
thrown in /var/www/yii/crm_2.3/vendor/yiisoft/yii2/base/Application.php on line 219" while reading response header from upstream, client: 127.0.0.1, server: mysite.test, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "127.0.0.1
А как надо подскажите.