diff --git a/backend/views/cart/index.php b/backend/views/cart/index.php
index a70caf8..9d2ef9a 100644
--- a/backend/views/cart/index.php
+++ b/backend/views/cart/index.php
@@ -10,6 +10,7 @@ use kartik\date\DatePicker;
$this->title = Yii::t('app', 'Заказы');
$this->params['breadcrumbs'][] = $this->title;
+
?>
@@ -25,6 +26,13 @@ $this->params['breadcrumbs'][] = $this->title;
'id',
'account_id',
+ ['label' =>'Информация',
+ 'value' =>function ($data) {
+ $info = $data->scode . ' /n';
+ $info .= $data->name;
+ return $info;
+ },
+ ],
'sum',
[
'label' =>'Статус',
@@ -34,17 +42,18 @@ $this->params['breadcrumbs'][] = $this->title;
'manager_name',
[
'label' =>'Дата',
+ 'value' =>function ($data) {
+ return date('Y-m-d', $data->dt);
+ },
'attribute' => 'dt',
'filter' => DatePicker::widget([
- 'name' => 'data1',
- // 'value' => '01-Feb-2015',
+ 'model' =>$searchModel,
+ 'language' =>'ru',
+ 'size' =>'xs',
+ 'separator' =>'по',
+ 'attribute' => 'dt',
'type' => DatePicker::TYPE_RANGE,
- 'name2' => 'data2',
- // 'value2' => '27-Feb-2015',
- 'pluginOptions' => [
- 'autoclose'=>true,
- 'format' => 'dd-M-yyyy'
- ]
+ 'attribute2' => 'date_to',
]),
],
diff --git a/common/models/CartBillsSearch.php b/common/models/CartBillsSearch.php
index 94bf8c1..dbe355f 100644
--- a/common/models/CartBillsSearch.php
+++ b/common/models/CartBillsSearch.php
@@ -13,7 +13,7 @@ use common\models\CartBillsView;
*/
class CartBillsSearch extends CartBillsView
{
-
+public $date_to;
/**
* @inheritdoc
*/
@@ -21,7 +21,7 @@ class CartBillsSearch extends CartBillsView
{
return [
[['id', 'account_id', 'status'], 'integer'],
- [['data1,data2'], 'safe'],
+ [['dt', 'date_to'], 'string', 'max' => 10],
];
}
@@ -50,8 +50,7 @@ class CartBillsSearch extends CartBillsView
]);
$this->load($params);
- //$timestamp= mktime($hours,$minutes,$seconds,$month,$day,$year);
- CustomVarDamp::dumpAndDie(date_timestamp_get($params['data1']));
+
if (!$this->validate()) {
// uncomment the following line if you do not want to return any records when validation fails
// $query->where('0=1');
@@ -61,10 +60,20 @@ class CartBillsSearch extends CartBillsView
$query->andFilterWhere([
'id' => $this->id,
'account_id' => $this->account_id,
- 'timestamp' => $this->dt,
'status_id' => $this->status,
]);
+ if($this->dt !== null || $this->date_to !== null){
+ $date_from = mktime(0,0,0,(int)substr($this->dt,4,2),(int)substr($this->dt,1,2),(int)substr($this->dt,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));
+
+ $query->andFilterWhere([
+ 'between', 'dt', $date_from, $date_to
+ ]);
+ }
+
+
+
// $query->andFilterWhere(['like', 'f1', $this->f1])
// ->andFilterWhere(['like', 'f2', $this->f2])
// ->andFilterWhere(['like', 'f3', $this->f3])
@@ -73,4 +82,9 @@ class CartBillsSearch extends CartBillsView
return $dataProvider;
}
+
+ public static function findById($id){
+
+ return CartBillsView::find()->where(['id' => $id])->one();
+ }
}
diff --git a/composer.lock b/composer.lock
index 53ed4be..3fcbc33 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
- "hash": "2d5c03f681f1c72d09f36e10af144465",
+ "hash": "ce73f971f407fe869277da60d0444492",
"content-hash": "4c8b69eb2733ca32596e438952d2f182",
"packages": [
{
diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json
index da660d5..15e699f 100644
--- a/vendor/composer/installed.json
+++ b/vendor/composer/installed.json
@@ -1140,57 +1140,6 @@
]
},
{
- "name": "kartik-v/yii2-widget-datepicker",
- "version": "v1.3.3",
- "version_normalized": "1.3.3.0",
- "source": {
- "type": "git",
- "url": "https://github.com/kartik-v/yii2-widget-datepicker.git",
- "reference": "368b181ef658c05707fe41dd16eee4d9ffd9da38"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/kartik-v/yii2-widget-datepicker/zipball/368b181ef658c05707fe41dd16eee4d9ffd9da38",
- "reference": "368b181ef658c05707fe41dd16eee4d9ffd9da38",
- "shasum": ""
- },
- "require": {
- "kartik-v/yii2-krajee-base": "~1.7"
- },
- "time": "2015-07-19 04:49:03",
- "type": "yii2-extension",
- "installation-source": "dist",
- "autoload": {
- "psr-4": {
- "kartik\\date\\": ""
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Kartik Visweswaran",
- "email": "kartikv2@gmail.com",
- "homepage": "http://www.krajee.com/"
- }
- ],
- "description": "Enhanced Yii2 wrapper for the bootstrap datepicker plugin (sub repo split from yii2-widgets).",
- "homepage": "https://github.com/kartik-v/yii2-widget-datepicker",
- "keywords": [
- "date",
- "extension",
- "form",
- "jquery",
- "picker",
- "plugin",
- "select2",
- "widget",
- "yii2"
- ]
- },
- {
"name": "kartik-v/yii2-field-range",
"version": "v1.3.0",
"version_normalized": "1.3.0.0",
@@ -1338,5 +1287,56 @@
"yii",
"yii2"
]
+ },
+ {
+ "name": "kartik-v/yii2-widget-datepicker",
+ "version": "v1.3.3",
+ "version_normalized": "1.3.3.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/kartik-v/yii2-widget-datepicker.git",
+ "reference": "368b181ef658c05707fe41dd16eee4d9ffd9da38"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/kartik-v/yii2-widget-datepicker/zipball/368b181ef658c05707fe41dd16eee4d9ffd9da38",
+ "reference": "368b181ef658c05707fe41dd16eee4d9ffd9da38",
+ "shasum": ""
+ },
+ "require": {
+ "kartik-v/yii2-krajee-base": "~1.7"
+ },
+ "time": "2015-07-19 04:49:03",
+ "type": "yii2-extension",
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "kartik\\date\\": ""
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Kartik Visweswaran",
+ "email": "kartikv2@gmail.com",
+ "homepage": "http://www.krajee.com/"
+ }
+ ],
+ "description": "Enhanced Yii2 wrapper for the bootstrap datepicker plugin (sub repo split from yii2-widgets).",
+ "homepage": "https://github.com/kartik-v/yii2-widget-datepicker",
+ "keywords": [
+ "date",
+ "extension",
+ "form",
+ "jquery",
+ "picker",
+ "plugin",
+ "select2",
+ "widget",
+ "yii2"
+ ]
}
]
--
libgit2 0.21.4