add contraint , that everybody expect admin is limited to 3 days, Add card package
This commit is contained in:
@@ -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]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user