Возвращаемый запрос в представлении codeigniter3

#php #codeigniter-3

Вопрос:

Поэтому я использую CodeIgniter3 для оформления заказа. Когда заказ сделан, мне нужно получить всю информацию на обзорной странице, что не является проблемой. Но теперь я хочу отобразить (несколько строк определенного order_ID , сохраненного в таблице DWO_Panelplating . Когда я загружаю свой запрос в своем представлении, я получаю все строки, но там много дубликатов (почти 2000 строк вместо 2 ).

Контроллер

 $data["panelplating"] = $this->Panelplating->read__entry($order_id);
 

Модель

 public function read__entry($id)
{
    $this->db->select("p.id, p.created_on, p.modified_on, p.order_id as order_id, p.type, p.material as material, p.thickness, p.amount, p.length_a as length_a, p.length_b1, length_b2, p.length_c, p.length_d, p.width, p.paint, p.color, p.paintA1, p.paintA2, p.paintB11, p.paintB12, p.paintB21, p.paintB22, p.paintC1, p.paintC2, p.paintD1, p.paintD2, pt.thickness as thickness_size, pt.pricerange1 as price_small, pt.pricerange2 as price_medium, pt.pricerange3 as price_large, pt.pricerange4 as price_xlarge, pll.type as type, c.ral_code as colorcode, pm.material as type_material");
    $this->db->from(join(" ", array(self::TABLE_NAME, self::TABLE_SHORT)));
    $this->db->join("DWO_Orders o", "p.order_id = o.id", "LEFT");
    $this->db->join("DWO_Platingamounts pl", "p.order_id = pl.order_id", "LEFT");
    $this->db->join("DWO_Platingamounts pll", "p.type = pll.type", "LEFT");
    $this->db->join("DWO_Platethicknesses pt", "p.thickness = pt.id", "LEFT");
    $this->db->join("DWO_Platingmaterials pm", "p.material = pm.id", "LEFT");
    $this->db->join("DWO_Colors c", "p.color = c.id", "LEFT");
    $this->db->where("p.order_id", $id);
    return $this->db->get()->result();

}
 

Вид

 <label for="plating" class="block text-sm font-medium text-gray-700 sm:mt-px sm:pt-2">
     <?php foreach ($panelplating as $plating):?>
     <?=    $plating->id?>
     <?php endforeach?>
</label>
 

У кого-нибудь есть предложение/решение по этому поводу?

Заранее спасибо! С уважением, Берт