Browse Source

[Administration] Commandes admin : ajustement index

feature/rotating_product
Guillaume Bourgeois 4 months ago
parent
commit
709b483685
3 changed files with 7 additions and 7 deletions
  1. +3
    -1
      backend/controllers/admin/OrderAdminController.php
  2. +3
    -2
      backend/views/order-admin/index.php
  3. +1
    -4
      domain/Order/Order/OrderSearch.php

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

public function actionIndex() public function actionIndex()
{ {
$searchModel = new OrderSearch(); $searchModel = new OrderSearch();
$dataProvider = $searchModel->search(array_merge(\Yii::$app->request->queryParams));
$dataProvider = $searchModel->search([
'order_by' => 'IF(ISNULL(date_update), `order`.`date`, `order`.`date_update`) DESC'
]);


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

+ 3
- 2
backend/views/order-admin/index.php View File

} }
], ],
[ [
'label' => 'Origine',
'label' => 'Utilisateur',
'format' => 'raw', 'format' => 'raw',
'value' => function ($order) use ($orderModule) { 'value' => function ($order) use ($orderModule) {
return $orderModule->getSolver()->getLabelOrigin($order, true);;
return $orderModule->getSolver()->getOrderUsername($order)
.'<br />'.$orderModule->getSolver()->getLabelOrigin($order, true);
} }
], ],
[ [

+ 1
- 4
domain/Order/Order/OrderSearch.php View File

{ {
public function search($params) public function search($params)
{ {
$orderRepository = OrderRepository::getInstance();
$optionsSearch = $orderRepository->getDefaultOptionsSearch() ;

$paramsSearch = []; $paramsSearch = [];
if(isset($params['id_user'])) { if(isset($params['id_user'])) {
$paramsSearch['id_user'] = $params['id_user']; $paramsSearch['id_user'] = $params['id_user'];


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

Loading…
Cancel
Save