add contraint , that everybody expect admin is limited to 3 days, Add card package

This commit is contained in:
2016-02-13 17:23:43 +01:00
parent 556bdc3066
commit 70f43468af
37 changed files with 1418 additions and 19 deletions

View File

@@ -14,6 +14,7 @@ use common\models\Account;
use yii\helpers\ArrayHelper;
use common\models\MoneyMovement;
use common\components\RoleDefinition;
use common\components\Helper;
/**
* TransferSearch represents the model behind the search form about `common\models\Transfer`.
*/
@@ -168,6 +169,16 @@ class TransferSaleSearch extends Transfer
$query->andFilterWhere(['or' , $created_condition , $paid_condition]);
$needRestirct = false;
if ( $this->isModeAdmin() ){
$needRestirct = !RoleDefinition::isAdmin();
}else{
$needRestirct = true;
}
if ( $needRestirct ){
Helper::restrictIfNotAdminTheStartDate($query, $this->timestampStart);
}
// $query->andWhere(['transfer.status' => Transfer::STATUS_PAID]);