- Добавлено новая константа, определяющая подписку пользователя

parent 994fc852
......@@ -21,6 +21,7 @@ use common\modules\users\models\User;
class TriggerLogs extends \yii\db\ActiveRecord
{
const USER_REGISTRATION = 'registration';
const USER_SUBSCRIBE = 'subscribe';
const USER_VISITED = 'visited';
public static function logAction()
......@@ -29,6 +30,8 @@ class TriggerLogs extends \yii\db\ActiveRecord
$action = self::USER_VISITED;
if (Yii::$app->controller->action->id=='registration')
$action = self::USER_REGISTRATION;
if (Yii::$app->request->getUrl()=='/bids/bid/add')
$action = self::USER_SUBSCRIBE;
$date = new \DateTime();
$model = new TriggerLogs();
$model->user_id = Yii::$app->user->identity->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