fix account_state ( collection_money ), display product/ticket on reception only for selected account, add daily transfers (reception/admin)

This commit is contained in:
2015-12-31 13:52:22 +01:00
parent 72fc139674
commit f59eadd8cc
26 changed files with 1153 additions and 404 deletions

View File

@@ -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;