- Добавлены константы в логи триггера

parent b1227b82
...@@ -18,6 +18,9 @@ use common\modules\users\models\User; ...@@ -18,6 +18,9 @@ use common\modules\users\models\User;
*/ */
class TriggerLogs extends \yii\db\ActiveRecord class TriggerLogs extends \yii\db\ActiveRecord
{ {
const USER_REGISTRATION = 'registration';
const USER_VISITED = 'visited';
/** /**
* @inheritdoc * @inheritdoc
*/ */
...@@ -32,11 +35,11 @@ class TriggerLogs extends \yii\db\ActiveRecord ...@@ -32,11 +35,11 @@ class TriggerLogs extends \yii\db\ActiveRecord
public function rules() public function rules()
{ {
return [ return [
[['user_id', 'action', 'datetime'], 'required'], [['user_id', 'action', 'datetime', 'url'], 'required'],
[['user_id', 'presence_time'], 'integer'], [['user_id', 'presence_time'], 'integer'],
[['datetime'], 'safe'], [['datetime'], 'safe'],
[['action'], 'string', 'max' => 255], [['action', 'url'], 'string', 'max' => 255],
[['user_id'], 'exist', 'skipOnError' => true, 'targetClass' => Users::className(), 'targetAttribute' => ['user_id' => 'id']], [['user_id'], 'exist', 'skipOnError' => true, 'targetClass' => User::className(), 'targetAttribute' => ['user_id' => 'id']],
]; ];
} }
......
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