@@ -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, |
@@ -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); | |||
} | |||
], | |||
[ |
@@ -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([ |