Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有人问我是否可以在 OpenCart 1.5 的管理区域中为产品编号。
编号如下:
1 2 3 4 5 等并在下一页继续。
我只是不确定如何进行计数并将数字拉到视图中。
我以前从未使用过 OpenCart 1.5,但是,使用一点 PHP 就可以让它工作:
(index + (page_size * (page_number - 1))
根据产品表的设置方式,您还可以输出表的主键。很多时候,这些将从一开始,每次递增一。然而,这样做的问题是,如果您删除产品#3,那么您的数字就会出现差距。
祝你好运!