浏览文章
文章信息
Magento2 按照属性获取产品|根据属性获取产品|并限制产品收集
16856
/** * 获取加购产品 * @param int $pageSize * @param int $pageNumber * @return string * @throws \Magento\Framework\Exception\LocalizedException */ function get($pageSize, $pageNumber) { $products = $this->product->getResourceCollection()->addAttributeToSelect(InstallData::purchase_FLAG_ATTR, 1)->setPageSize($pageSize)->setCurPage($pageNumber)->getData(); return $this->success('请求成功!',$products,'addPurchaseProductGetOK'); }