/** * Get orders details to create Tickets * * @static * @param array $orderIdList * @param int $filterEntries * @param int $weight_coefficient * @return array */ public static function getOrders($orderIdList = array(), $filterEntries = MondialRelay::NO_FILTER, $weight_coefficient = 0) { $account_shop = MondialRelay::getAccountDetail(); $id_order_state = $account_shop['MR_ORDER_STATE']; $sql = MondialRelay::getBaseOrdersSQLQuery($id_order_state, $weight_coefficient); if (count($orderIdList)) { $sql .= ' AND o.id_order IN ('; foreach ($orderIdList as $id_order) { $sql .= (int) $id_order . ', '; } $sql = rtrim($sql, ', ') . ')'; } switch ($filterEntries) { case MondialRelay::WITHOUT_HOME_DELIVERY: $sql .= 'AND mr.mr_ModeLiv != "LD1" AND mr.mr_ModeLiv != "LDS"'; break; } $sql .= ' GROUP BY o.`id_order` ORDER BY o.`date_add` ASC'; return Db::getInstance()->executeS($sql); }