change version to v.0.0.14 , add admin menu changes, add collection change
This commit is contained in:
@@ -8,6 +8,7 @@ use yii\data\ActiveDataProvider;
|
||||
use common\models\Collection;
|
||||
use common\components\Helper;
|
||||
use common\components\RoleDefinition;
|
||||
use common\models\Account;
|
||||
|
||||
/**
|
||||
* CollectionSearch represents the model behind the search form about `common\models\Collection`.
|
||||
@@ -56,11 +57,20 @@ class CollectionSearch extends Collection
|
||||
public function search($params)
|
||||
{
|
||||
$query = Collection::find();
|
||||
|
||||
$query->innerJoinWith('account');
|
||||
|
||||
|
||||
if ( !RoleDefinition::isAdmin() ){
|
||||
$query->innerJoin("user_account_assignment",'collection.id_account = user_account_assignment.id_account' );
|
||||
$query->andWhere(['user_account_assignment.id_user' => Yii::$app->user->id ]);
|
||||
|
||||
$query->andWhere(['account.type' => Account::TYPE_ALL ]);
|
||||
|
||||
if ( RoleDefinition::isReception()){
|
||||
$query->andWhere(['transfer.id_user' => Yii::$app->user->id ]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$dataProvider = new ActiveDataProvider([
|
||||
|
||||
Reference in New Issue
Block a user