fix

parent e255e013
......@@ -34,10 +34,11 @@ use Yii;
*/
class Reviews extends \common\components\ActiveRecordModel
{
public $image;
const PHOTO_FOLDER = '/uploads/reviews/';
public $image;
public $photo_delete;
private static $rate = [
'rate_usability' => [
0 => 'Не определено',
......@@ -65,7 +66,8 @@ class Reviews extends \common\components\ActiveRecordModel
],
];
public static function getSource($type) {
public static function getSource($type)
{
return self::$rate[$type];
}
......@@ -100,7 +102,7 @@ class Reviews extends \common\components\ActiveRecordModel
[['image'], 'file', 'skipOnEmpty' => true, 'extensions' => 'png, jpg, jpeg, gif'],
[['text', 'state', 'attendant_products'], 'string'],
[['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],
[['title'], 'string', 'max' => 250],
[['email', 'video'], 'string', 'max' => 255]
......
......@@ -5,7 +5,7 @@ use yii\helpers\Html;
$reviews = Reviews::find()
->where(['state' => 'active'])
->orderBy('created_at DESC')
->limit(2)
->limit(1)
->all();
?>
<?php if($reviews) : ?>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment