public function actionGetRecipientsList()
 {
     $params = ApiParams::getPostJsonParams();
     $model = Validation::checkUserAuthorization($params);
     if ($model->errors) {
         Utils::echoErrorResponse($model->getFirstErrors());
     } else {
         $recipiens = Recipients::find()->asArray()->all();
         $groups = Groups::find()->select('code')->asArray()->all();
         $groups_members = $this->getGroupsMembers($groups);
         Utils::echoSuccessResponse($groups_members);
     }
 }
Пример #2
0
 public function getRecipientName($model)
 {
     $recipient = Recipients::find()->where(['code' => $model->recipient_code])->one();
     return $recipient->name;
 }