แต่ว่า ผม แปลงค่าจาก Arary มาแล้ว มันนำไปใส่ไม่ได้ครับ ต้องใส่ตรงไหนถึงจะถูกหลักครับ โค้ดที่แปลงมาคือเป็นตัวแปร $setid ครับ
พอเช็คค่า $setid ดูก็จะได้ 1,2,3,4 ครับแต่ว่า นำไปใส่ใน Where ไมไ่ด้ครับ
โค้ดที่ดึงค่าจาก Fields ครับ
โค้ด: เลือกทั้งหมด
$helper_newproduct = new ModShowProductNewItem();
$product_slisdershow = $helper_newproduct->newItem($params->get('selectid'));
โค้ดของคลาสแสดงข้อมูลครับ
โค้ด: เลือกทั้งหมด
class ModShowProductNewItem
{
public function newItem($product_slisdershow)
{
$lang_tag = \Joomla\CMS\Factory::getLanguage()->getTag();
$db = Joomla\CMS\Factory::getDbo();
$query = $db ->getQuery(true)
->select('a.category_id, b.product_id, b.image ,b.product_price,'.$db->qn('b.name_'.$lang_tag))
->from('#__mzc_products as b')
->where('a.product_id in ('.$product_slisdershow.')')
->leftJoin('#__mzc_products_to_categories AS a ON b.product_id = a.product_id')
->order('product_id DESC');
$db->setQuery($query,0,$product_slisdershow);
//ตัวที่แปลงมาจาก Array
$setid = implode(",", $product_slisdershow);
echo $setid;
exit();
$items = $db ->loadAssocList();
return $items;
}