Skip to content

Commit eb71995

Browse files
dev
1 parent 5f594ae commit eb71995

File tree

2 files changed

+37
-12
lines changed

2 files changed

+37
-12
lines changed

src/controllers/AdminShopBrandController.php

+18-6
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010

1111
use skeeks\cms\backend\controllers\BackendModelStandartController;
1212
use skeeks\cms\grid\BooleanColumn;
13+
use skeeks\cms\grid\DateTimeColumnData;
1314
use skeeks\cms\grid\ImageColumn2;
15+
use skeeks\cms\grid\UserColumnData;
1416
use skeeks\cms\helpers\Image;
1517
use skeeks\cms\models\CmsCountry;
1618
use skeeks\cms\queryfilters\QueryFiltersEvent;
@@ -40,15 +42,15 @@ public function init()
4042
$this->modelShowAttribute = "name";
4143
$this->modelClassName = ShopBrand::class;
4244

43-
$this->generateAccessActions = false;
44-
$this->permissionName = CmsManager::PERMISSION_ADMIN_ACCESS;
45+
$this->generateAccessActions = true;
46+
/*$this->permissionName = CmsManager::PERMISSION_ADMIN_ACCESS;*/
4547

46-
$this->accessCallback = function () {
48+
/*$this->accessCallback = function () {
4749
if (!\Yii::$app->skeeks->site->is_default) {
4850
return false;
4951
}
5052
return \Yii::$app->user->can(CmsManager::PERMISSION_ROLE_ADMIN_ACCESS);
51-
};
53+
};*/
5254

5355

5456
parent::init();
@@ -126,7 +128,7 @@ public function actions()
126128
],
127129
'grid' => [
128130
'defaultOrder' => [
129-
'name' => SORT_ASC,
131+
'created_at' => SORT_DESC,
130132
],
131133
/*'sortAttributes' => [
132134
'countProducts' => [
@@ -141,18 +143,28 @@ public function actions()
141143
'checkbox',
142144
'actions',
143145

146+
'created_at',
144147
'custom',
145148

146149
'country_alpha2',
147150

148151
'countProducts',
149152
'is_active',
150-
'priority',
153+
'created_by',
151154
'view',
152155
],
153156

154157
'columns' => [
155158

159+
'created_at' => [
160+
'class' => DateTimeColumnData::class
161+
],
162+
'updated_at' => [
163+
'class' => DateTimeColumnData::class
164+
],
165+
'created_by' => [
166+
'class' => UserColumnData::class
167+
],
156168
'countProducts' => [
157169
'format' => 'raw',
158170
'value' => function (ShopBrand $shopBrand) {

src/controllers/AdminShopCollectionController.php

+19-6
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010

1111
use skeeks\cms\backend\controllers\BackendModelStandartController;
1212
use skeeks\cms\grid\BooleanColumn;
13+
use skeeks\cms\grid\DateTimeColumnData;
1314
use skeeks\cms\grid\ImageColumn2;
15+
use skeeks\cms\grid\UserColumnData;
1416
use skeeks\cms\helpers\Image;
1517
use skeeks\cms\models\CmsCountry;
1618
use skeeks\cms\queryfilters\QueryFiltersEvent;
@@ -42,15 +44,15 @@ public function init()
4244
$this->modelShowAttribute = "name";
4345
$this->modelClassName = ShopCollection::class;
4446

45-
$this->generateAccessActions = false;
46-
$this->permissionName = CmsManager::PERMISSION_ROLE_ADMIN_ACCESS;
47+
$this->generateAccessActions = true;
48+
/*$this->permissionName = CmsManager::PERMISSION_ROLE_ADMIN_ACCESS;*/
4749

48-
$this->accessCallback = function () {
50+
/*$this->accessCallback = function () {
4951
if (!\Yii::$app->skeeks->site->is_default) {
5052
return false;
5153
}
5254
return \Yii::$app->user->can(CmsManager::PERMISSION_ROLE_ADMIN_ACCESS);
53-
};
55+
};*/
5456

5557

5658
parent::init();
@@ -127,7 +129,7 @@ public function actions()
127129
],
128130
'grid' => [
129131
'defaultOrder' => [
130-
'name' => SORT_ASC,
132+
'created_at' => SORT_DESC,
131133
],
132134
/*'sortAttributes' => [
133135
'countProducts' => [
@@ -142,18 +144,29 @@ public function actions()
142144
'checkbox',
143145
'actions',
144146

147+
'created_at',
145148
'custom',
146149

147150
'brand',
148151

149152
'countProducts',
150153
'is_active',
151-
'priority',
154+
'created_by',
152155
'view',
153156
],
154157

155158
'columns' => [
156159

160+
'created_at' => [
161+
'class' => DateTimeColumnData::class
162+
],
163+
'updated_at' => [
164+
'class' => DateTimeColumnData::class
165+
],
166+
'created_by' => [
167+
'class' => UserColumnData::class
168+
],
169+
157170
'countProducts' => [
158171
'format' => 'raw',
159172
'value' => function (ShopCollection $shopBrand) {

0 commit comments

Comments
 (0)