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

- Возвращено свойство recall
parent ffee3bf4
...@@ -5,12 +5,15 @@ namespace common\modules\triggers\components\conditions\conditions; ...@@ -5,12 +5,15 @@ namespace common\modules\triggers\components\conditions\conditions;
use common\components\UnisenderAPI; use common\components\UnisenderAPI;
use common\modules\triggers\components\conditions\vendor\ConditionBase; use common\modules\triggers\components\conditions\vendor\ConditionBase;
use common\modules\triggers\components\conditions\vendor\ConditionInterface; use common\modules\triggers\components\conditions\vendor\ConditionInterface;
use common\modules\users\models\User;
class CheckUserToRegistration extends ConditionBase implements ConditionInterface{ class CheckUserToRegistration extends ConditionBase implements ConditionInterface{
const CONDITION_ID = 6; const CONDITION_ID = 6;
public $name = 'Пользователь зарегистрировался (Игнорируется оператором "И")'; public $name = 'Пользователь зарегистрировался (Игнорируется оператором "И")';
public $recall=false;
/** /**
* @param null|string $conditionName * @param null|string $conditionName
* @return $this mixed * @return $this mixed
...@@ -24,6 +27,7 @@ class CheckUserToRegistration extends ConditionBase implements ConditionInterfac ...@@ -24,6 +27,7 @@ class CheckUserToRegistration extends ConditionBase implements ConditionInterfac
* @return bool * @return bool
*/ */
public function check($message){ public function check($message){
return true; $exists = User::find()->where(['email' => $message->email])->exists();
return $exists;
} }
} }
\ No newline at end of file
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