add changes feature/33
This commit is contained in:
@@ -108,4 +108,21 @@ class Account extends \yii\db\ActiveRecord
|
||||
return $this->status == self::STATUS_DELETED;
|
||||
}
|
||||
|
||||
/**
|
||||
* $param int $forceIncludeAccount id account, that should be included in list, even if it is inactive
|
||||
* */
|
||||
public static function readAccounts($forceIncludeAccount = null){
|
||||
$accounts = null;
|
||||
|
||||
if ( $forceIncludeAccount == null){
|
||||
$accounts = Account::find()->andWhere(['status' => Account::STATUS_ACTIVE])->all();
|
||||
}else{
|
||||
$accounts = Account::find()->andWhere( ['or', ['status' => Account::STATUS_ACTIVE], ['id_account' => $forceIncludeAccount ] ])->all();
|
||||
}
|
||||
|
||||
return $accounts;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user