{ | { | ||||
$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' | ||||
]); | ]); | ||||
} | } | ||||
$query = Order::searchQuery($paramsSearch, [ | $query = Order::searchQuery($paramsSearch, [ | ||||
'ignore_id_producer' => true, | |||||
'orderby' => isset($params['order_by']) ? $params['order_by'] : 'distribution.date DESC' | 'orderby' => isset($params['order_by']) ? $params['order_by'] : 'distribution.date DESC' | ||||
]); | ]); | ||||