add cassaopen/default account behaviors
This commit is contained in:
@@ -194,6 +194,8 @@ class AccountState extends \common\models\BaseFitnessActiveRecord
|
||||
* Read last accountstates
|
||||
* @param $type int the type of accountstate to load
|
||||
* @param $user $id of user to load the account
|
||||
* @return common\models\AccountState
|
||||
*
|
||||
* */
|
||||
public static function readLast($type, $user = null,$account = null){
|
||||
$result = null;
|
||||
@@ -202,9 +204,13 @@ class AccountState extends \common\models\BaseFitnessActiveRecord
|
||||
if ( isset($type)){
|
||||
$query->andWhere(['account_state.type' => $type]);
|
||||
}
|
||||
if ( $account ){
|
||||
if ( isset( $account ) ){
|
||||
$query->andWhere(["account_state.id_account" => $account ]);
|
||||
}
|
||||
|
||||
if ( isset( $user ) ){
|
||||
$query->andWhere(["account_state.id_user" => $user ]);
|
||||
}
|
||||
|
||||
$query->limit(1);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user