public function products(LangRequest $request, Discount $id): JsonResource 	{ 		if (!$id->isAvailable()) { 			abort(403, 'Discount not active'); 		}  		// $result = DB::select('select(final.code) from (select prefinal.name, prefinal.code, prefinal.amount, max(prefinal.amount), max(prefinal.is_percentage), prefinal.discountid from ((SELECT products.code, products.name, discounts.amount, discounts.is_percentage, discounts.id as discountid, discounts.title from products join discount_items on discount_items.item_id = products.id join discounts on discount_items.discount_id = discounts.id) 		// 			union 		// (SELECT products.code, products.name, discounts.amount, discounts.is_percentage, discounts.id as discountid, discounts.title from products join product_categories on products.id = product_categories.product_id join discount_items on discount_items.item_id = product_categories.category_id join discounts on discount_items.discount_id = discounts.id)) as prefinal where prefinal.discountid = ? group by prefinal.code) as final', [$id->id]);  		// $skus = [];  		// foreach ($result as $item) { 		// 	$skus[] = $item->code; 		// }  		return ProductListResource::collection(Product::available()->includes()->underActiveDiscount($id->id)->latest()->paginate()); 	}