Browse Source

Page Crédit : ajout du filtre id_user

dev
Guillaume Bourgeois 5 years ago
parent
commit
f83c0972a6
2 changed files with 7 additions and 0 deletions
  1. +6
    -0
      common/models/CreditHistorySearch.php
  2. +1
    -0
      producer/controllers/CreditController.php

+ 6
- 0
common/models/CreditHistorySearch.php View File

if (!$this->validate()) { if (!$this->validate()) {
return $dataProvider; return $dataProvider;
} }
if(isset($this->id_user) && is_numeric($this->id_user)) {
$query->andWhere([
'credit_history.id_user' => $this->id_user
]) ;
}


return $dataProvider; return $dataProvider;
} }

+ 1
- 0
producer/controllers/CreditController.php View File

public function actionHistory($returnPayment = '') public function actionHistory($returnPayment = '')
{ {
$searchModel = new CreditHistorySearch() ; $searchModel = new CreditHistorySearch() ;
$searchModel->id_user = User::getCurrentId() ;
$dataProvider = $searchModel->search(Yii::$app->request->queryParams); $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
$userProducer = UserProducer::searchOne([ $userProducer = UserProducer::searchOne([

Loading…
Cancel
Save