#1068 - Не работает sitemap.xml / Редакция отображения поля Приоритет в Sitemap

parent f92a6316
......@@ -117,10 +117,9 @@ class CoContent extends \common\components\ActiveRecordModel
return [
[['active', 'type'], 'integer'],
[['file'], 'file', 'skipOnEmpty' => true, 'extensions' => 'png, jpg, jpeg, gif'],
[['url', 'type'], 'required'],
[['url', 'type', 'priority'], 'required'],
[['url'], 'string', 'max' => 250],
[['category_id', 'priority', 'custom'], 'safe'],
[['priority'], 'double']
[['category_id', 'custom'], 'safe'],
];
}
......@@ -206,4 +205,17 @@ class CoContent extends \common\components\ActiveRecordModel
}
}
}
public function beforeSave($insert)
{
if (parent::beforeSave($insert))
{
$this->priority = str_replace(',', '.', $this->priority);
return true;
}
else
{
return false;
}
}
}
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