Пример #1
0
 public function getPayment()
 {
     if ($this->user_type !== 'student') {
         return $this->hasOne(ApproveInformations::className(), ['payment_user_id' => 'user_id']);
     } else {
         return $this->hasOne(PaymentInformations::className(), ['payment_user_id' => 'user_id']);
     }
 }
Пример #2
0
 private function getStudentName()
 {
     return $this->hasOne(PaymentInformations::className(), ['payment_user_id' => 'user_id'])->select('`payment_first_name`, `payment_last_name`')->one();
 }