fix backend user access, fix payout cart account change
This commit is contained in:
@@ -69,12 +69,12 @@ class TransferSearch extends Transfer
|
||||
$query = Transfer::find();
|
||||
|
||||
$query->innerJoinWith('account');
|
||||
$query->innerJoin('user', " user.id = transfer.id_user");
|
||||
|
||||
|
||||
if ( !RoleDefinition::isAdmin() ){
|
||||
$query->innerJoin("user_account_assignment",'transfer.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()){
|
||||
@@ -84,6 +84,42 @@ class TransferSearch extends Transfer
|
||||
|
||||
$dataProvider = new ActiveDataProvider([
|
||||
'query' => $query,
|
||||
'sort' =>[
|
||||
'attributes' =>[
|
||||
'paid_at' =>[
|
||||
'asc' => ['transfer.paid_at' => SORT_ASC ],
|
||||
'desc' => ['transfer.paid_at' => SORT_DESC],
|
||||
],
|
||||
'created_at' =>[
|
||||
'asc' => ['transfer.created_at' => SORT_ASC ],
|
||||
'desc' => ['transfer.created_at' => SORT_DESC],
|
||||
],
|
||||
'status' =>[
|
||||
'asc' => ['transfer.status' => SORT_ASC ],
|
||||
'desc' => ['transfer.status' => SORT_DESC],
|
||||
],
|
||||
'money' =>[
|
||||
'asc' => ['transfer.money' => SORT_ASC ],
|
||||
'desc' => ['transfer.money' => SORT_DESC],
|
||||
],
|
||||
'count' =>[
|
||||
'asc' => ['transfer.count' => SORT_ASC ],
|
||||
'desc' => ['transfer.count' => SORT_DESC],
|
||||
],
|
||||
'item_price' =>[
|
||||
'asc' => ['transfer.item_price' => SORT_ASC ],
|
||||
'desc' => ['transfer.item_price' => SORT_DESC],
|
||||
],
|
||||
'id_account' =>[
|
||||
'asc' => ['account.name' => SORT_ASC ],
|
||||
'desc' => ['account.name' => SORT_DESC],
|
||||
],
|
||||
'id_user' =>[
|
||||
'asc' => ['user.username' => SORT_ASC ],
|
||||
'desc' => ['user.username' => SORT_DESC],
|
||||
],
|
||||
]
|
||||
]
|
||||
]);
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user