<?php 
final class DModelLocalisationOrderStatus extends Model {

    public function getOrderStatusMessage($order_status_id = '') {
        $order_status_data = array();
        if ($order_status_id) {
          $query = $this->db->query("SELECT * FROM " . DB_PREFIX . "order_status_message WHERE order_status_id = " . (int)$order_status_id);
        } else {
          $query = $this->db->query("SELECT * FROM " . DB_PREFIX . "order_status_message");
        }
    
        return $query->rows;
    }

    public function getOrderStatusServerList($futuraServer_status, $order_status_id = false, $list_only_status_ids = false){
      $sql = "SELECT ".( $list_only_status_ids ? "group_concat(os.order_status_id SEPARATOR  ',') as list_ids" : '*')." FROM oc_order_status os
      WHERE os.order_futuraserver_status =$futuraServer_status  AND os.language_id = '". (int)$this->config->get('config_language_id') ."'";

      if ($order_status_id){
        $sql .= ' AND order_status_id = '.$order_status_id;
      }

      $query = $this->db->query($sql);
      
      if (count($query->rows)>0){
        return $list_only_status_ids ?  $query->rows[0]['list_ids'] : $query->rows;
      }else{
        return false;
      }
    
    }

}