Browse Source

[Administration] Utilisateurs > Commandes : ajout filtre par producteur

develop
Guillaume Bourgeois 1 month ago
parent
commit
61c59abafd
2 changed files with 5 additions and 3 deletions
  1. +2
    -1
      backend/controllers/admin/OrderAdminController.php
  2. +3
    -2
      domain/Order/Order/OrderSearch.php

+ 2
- 1
backend/controllers/admin/OrderAdminController.php View File

{ {
$searchModel = new OrderSearch(); $searchModel = new OrderSearch();
$dataProvider = $searchModel->search([ $dataProvider = $searchModel->search([
'ignore_id_producer' => true,
'order_by' => 'IF(ISNULL(date_update), `order`.`date`, `order`.`date_update`) DESC' 'order_by' => 'IF(ISNULL(date_update), `order`.`date`, `order`.`date_update`) DESC'
], [
'ignore_id_producer' => true,
]); ]);


return $this->render('index', [ return $this->render('index', [

+ 3
- 2
domain/Order/Order/OrderSearch.php View File



class OrderSearch extends Order class OrderSearch extends Order
{ {
public function search($params)
public function search($params, $options = [])
{ {
$paramsSearch = []; $paramsSearch = [];
if(isset($params['id_user'])) { if(isset($params['id_user'])) {
} }


$query = Order::searchQuery($paramsSearch, [ $query = Order::searchQuery($paramsSearch, [
'orderby' => isset($params['order_by']) ? $params['order_by'] : 'distribution.date DESC'
'orderby' => isset($params['order_by']) ? $params['order_by'] : 'distribution.date DESC',
'ignore_id_producer' => isset($options['ignore_id_producer']) ? $options['ignore_id_producer'] : false
]); ]);
$dataProvider = new ActiveDataProvider([ $dataProvider = new ActiveDataProvider([

Loading…
Cancel
Save