fix account_state ( collection_money ), display product/ticket on reception only for selected account, add daily transfers (reception/admin)
This commit is contained in:
@@ -198,13 +198,13 @@ class TicketType extends \common\models\BaseFitnessActiveRecord {
|
||||
/**
|
||||
* $param int $forceIncludeAccount id account, that should be included in list, even if it is inactive
|
||||
* */
|
||||
public static function read($forceIncludeObjectWithId = null){
|
||||
public static function read($forceIncludeObjectWithId = null, $account = null){
|
||||
$ticketTypes = null;
|
||||
|
||||
if ( $forceIncludeObjectWithId == null){
|
||||
$ticketTypes = TicketType::find()->andWhere(['status' => self::STATUS_ACTIVE])->all();
|
||||
$ticketTypes = TicketType::find()->andWhere(['status' => self::STATUS_ACTIVE])->andFilterWhere(['ticket_type.id_account' => $account])->all();
|
||||
}else{
|
||||
$ticketTypes = TicketType::find()->andWhere( ['or', ['status' => self::STATUS_ACTIVE], ['id_ticket_type' => $forceIncludeObjectWithId ] ])->all();
|
||||
$ticketTypes = TicketType::find()->andWhere( ['or', ['status' => self::STATUS_ACTIVE], ['id_ticket_type' => $forceIncludeObjectWithId ] ])->andFilterWhere(['ticket_type.id_account' => $account])->all();
|
||||
}
|
||||
|
||||
return $ticketTypes;
|
||||
|
||||
Reference in New Issue
Block a user