为什么prestashop不返回产品附件的ID?

问题描述

我在产品上添加了test.pdf附件:

enter image description here

附件已正确保存在db中:

enter image description here

在CategoryController中,我正在寻找这样的附件:

workerList

但是,如果我尝试记录结果,我将得到类似这样的信息:

$prod->getAttachments();

您可以看到file_name是正确的,但是没有填充id_attachment字段,因此我无法像往常一样通过Link-> getPageLink建立任何链接

为什么不返回ID?我在做什么错了?

解决方法

我自己找到了一个答案:$prod->getAttachments();需要id_lang才能通过。