add contraint , that everybody expect admin is limited to 3 days, Add card package
This commit is contained in:
@@ -6,6 +6,7 @@ use Yii;
|
||||
use yii\base\Model;
|
||||
use yii\data\ActiveDataProvider;
|
||||
use common\models\AccountState;
|
||||
use common\components\Helper;
|
||||
|
||||
/**
|
||||
* AccountstateSearch represents the model behind the search form about `common\models\AccountState`.
|
||||
@@ -80,6 +81,8 @@ class AccountstateSearch extends AccountState
|
||||
$query->andFilterWhere([ '>=', 'account_state.created_at', $this->timestampStart ] );
|
||||
$query->andFilterWhere([ '<', 'account_state.created_at', $this->timestampEnd ] );
|
||||
|
||||
Helper::restrictIfNotAdminTheStartDate($query, $this->timestampStart, ['account_state.created_at']);
|
||||
|
||||
$query->orderBy( 'created_at desc' );
|
||||
|
||||
$query->limit = 20;
|
||||
|
||||
Reference in New Issue
Block a user