- Добавлено условие на определение регистрации пользователя

parent 6b8e0805
......@@ -26,10 +26,13 @@ class TriggerLogs extends \yii\db\ActiveRecord
public static function logAction()
{
if (!Yii::$app->user->isGuest) {
$action = self::USER_VISITED;
if (Yii::$app->controller->action->id=='registration')
$action = self::USER_REGISTRATION;
$date = new \DateTime();
$model = new TriggerLogs();
$model->user_id = Yii::$app->user->identity->id;
$model->action = self::USER_VISITED;
$model->action = $action;
$model->url = Yii::$app->request->getUrl();
$model->datetime = $date->format('Y-m-d H:i:s');
$model->presence_time = 1;
......
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