255], ]; } public function search($params) { $paymentRepository = PaymentRepository::getInstance(); $optionsSearch = $paymentRepository->getDefaultOptionsSearch() ; $query = Payment::find() ->with($optionsSearch['with']) ->innerJoinWith($optionsSearch['join_with'], true) ->where([ 'payment.id_producer' => GlobalParam::getCurrentProducerId(), //'payment.mean_payment' => MeanPayment::CREDIT ]) ->orderBy('id DESC') ; $dataProvider = new ActiveDataProvider([ 'query' => $query, 'sort' => false, 'pagination' => [ 'pageSize' => 20, ], ]); $this->load($params); if (!$this->validate()) { return $dataProvider; } if(isset($this->id_user) && is_numeric($this->id_user)) { $query->andWhere([ 'payment.id_user' => $this->id_user ]) ; } return $dataProvider; } }