Ver código fonte

[Administration] Commandes admin : ajustement index

feature/rotating_product
Guillaume Bourgeois 4 meses atrás
pai
commit
709b483685
3 arquivos alterados com 7 adições e 7 exclusões
  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 Ver arquivo

@@ -67,7 +67,9 @@ class OrderAdminController extends BackendController
public function actionIndex()
{
$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', [
'searchModel' => $searchModel,

+ 3
- 2
backend/views/order-admin/index.php Ver arquivo

@@ -71,10 +71,11 @@ $this->addBreadcrumb('Commandes') ;
}
],
[
'label' => 'Origine',
'label' => 'Utilisateur',
'format' => 'raw',
'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 Ver arquivo

@@ -44,9 +44,6 @@ class OrderSearch extends Order
{
public function search($params)
{
$orderRepository = OrderRepository::getInstance();
$optionsSearch = $orderRepository->getDefaultOptionsSearch() ;

$paramsSearch = [];
if(isset($params['id_user'])) {
$paramsSearch['id_user'] = $params['id_user'];
@@ -54,7 +51,7 @@ class OrderSearch extends Order

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

Carregando…
Cancelar
Salvar