Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
taskonsite-архив-перенесен
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dmitry Korolev
taskonsite-архив-перенесен
Commits
6b1d04f9
Commit
6b1d04f9
authored
Feb 08, 2016
by
Олег Гиммельшпах
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
e255e013
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
5 deletions
+7
-5
common/modules/reviews/models/Reviews.php
common/modules/reviews/models/Reviews.php
+6
-4
frontend/views/layouts/block/about-reviews.php
frontend/views/layouts/block/about-reviews.php
+1
-1
No files found.
common/modules/reviews/models/Reviews.php
View file @
6b1d04f9
...
@@ -34,10 +34,11 @@ use Yii;
...
@@ -34,10 +34,11 @@ use Yii;
*/
*/
class
Reviews
extends
\common\components\ActiveRecordModel
class
Reviews
extends
\common\components\ActiveRecordModel
{
{
public
$image
;
const
PHOTO_FOLDER
=
'/uploads/reviews/'
;
const
PHOTO_FOLDER
=
'/uploads/reviews/'
;
public
$image
;
public
$photo_delete
;
private
static
$rate
=
[
private
static
$rate
=
[
'rate_usability'
=>
[
'rate_usability'
=>
[
0
=>
'Не определено'
,
0
=>
'Не определено'
,
...
@@ -65,7 +66,8 @@ class Reviews extends \common\components\ActiveRecordModel
...
@@ -65,7 +66,8 @@ class Reviews extends \common\components\ActiveRecordModel
],
],
];
];
public
static
function
getSource
(
$type
)
{
public
static
function
getSource
(
$type
)
{
return
self
::
$rate
[
$type
];
return
self
::
$rate
[
$type
];
}
}
...
@@ -100,7 +102,7 @@ class Reviews extends \common\components\ActiveRecordModel
...
@@ -100,7 +102,7 @@ class Reviews extends \common\components\ActiveRecordModel
[[
'image'
],
'file'
,
'skipOnEmpty'
=>
true
,
'extensions'
=>
'png, jpg, jpeg, gif'
],
[[
'image'
],
'file'
,
'skipOnEmpty'
=>
true
,
'extensions'
=>
'png, jpg, jpeg, gif'
],
[[
'text'
,
'state'
,
'attendant_products'
],
'string'
],
[[
'text'
,
'state'
,
'attendant_products'
],
'string'
],
[[
'admin_id'
],
'adminIdValidate'
],
[[
'admin_id'
],
'adminIdValidate'
],
[[
'date'
,
'answer'
,
'good'
,
'bad'
,
'date_create'
,
'notification_date'
,
'rate_usability'
,
'rate_loyality'
,
'rate_profit'
,
'title'
,
'order'
,
'photo'
,
'state'
,
'video'
],
'safe'
],
[[
'date'
,
'answer'
,
'good'
,
'bad'
,
'date_create'
,
'notification_date'
,
'rate_usability'
,
'rate_loyality'
,
'rate_profit'
,
'title'
,
'order'
,
'photo'
,
'state'
,
'video'
,
'photo_delete'
],
'safe'
],
// [['lang'], 'string', 'max' => 2],
// [['lang'], 'string', 'max' => 2],
[[
'title'
],
'string'
,
'max'
=>
250
],
[[
'title'
],
'string'
,
'max'
=>
250
],
[[
'email'
,
'video'
],
'string'
,
'max'
=>
255
]
[[
'email'
,
'video'
],
'string'
,
'max'
=>
255
]
...
...
frontend/views/layouts/block/about-reviews.php
View file @
6b1d04f9
...
@@ -5,7 +5,7 @@ use yii\helpers\Html;
...
@@ -5,7 +5,7 @@ use yii\helpers\Html;
$reviews
=
Reviews
::
find
()
$reviews
=
Reviews
::
find
()
->
where
([
'state'
=>
'active'
])
->
where
([
'state'
=>
'active'
])
->
orderBy
(
'created_at DESC'
)
->
orderBy
(
'created_at DESC'
)
->
limit
(
2
)
->
limit
(
1
)
->
all
();
->
all
();
?>
?>
<?php
if
(
$reviews
)
:
?>
<?php
if
(
$reviews
)
:
?>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment