add frontend ticket changes
This commit is contained in:
@@ -70,4 +70,58 @@ class Ticket extends \common\models\BaseFitnessActiveRecord
|
||||
'updated_at' => Yii::t('common/ticket', 'Updated At'),
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
public function getCard(){
|
||||
return $this->hasOne( Card::className(), ["id_card" =>"id_card" ] );
|
||||
}
|
||||
|
||||
public function getUser(){
|
||||
return $this->hasOne( User::className(), ["id" =>"id_user" ] );
|
||||
}
|
||||
|
||||
public function getTicketType(){
|
||||
return $this->hasOne( TicketType::className(), ["id_ticket_type" =>"id_ticket_type" ] );
|
||||
}
|
||||
public function getDiscount(){
|
||||
return $this->hasOne( Discount::className(), ["id_discount" =>"id_discount" ] );
|
||||
}
|
||||
|
||||
public function getAccount() {
|
||||
return $this->hasOne ( Account::className (), [
|
||||
'id_account' => 'id_account'
|
||||
] );
|
||||
}
|
||||
public function getAccountName() {
|
||||
$result = "";
|
||||
$account = $this->account;
|
||||
if ( isset($account) ){
|
||||
$result = $this->account->name;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
public function getDiscountName() {
|
||||
$result = "";
|
||||
$discount = $this->discount;
|
||||
if ( isset($discount) ){
|
||||
$result = $this->discount->name;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
public function getTicketTypeName() {
|
||||
$result = "";
|
||||
$ticketType = $this->ticketType;
|
||||
if ( isset($ticketType) ){
|
||||
$result = $ticketType->name;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
public function getUserName() {
|
||||
$result = "";
|
||||
$user = $this->user;
|
||||
if ( isset($user) ){
|
||||
$result = $user->username;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user