本地评论插件bug
待回答本地评论插件 Addons\LocalComment\Controller\IndexController.class.php中 第63行,为被评论对象的评论数统计字段+1,
D($aCountModel)->where(array('id' => $aRowId))->setInc($aCountField);代码中把主键字段写死了为id,如果某对象的主键字段不为id(比如 product_id),那么where条件是无效的,实际的sql语句为:UPDATE `ocenter_product` SET `comment`=comment+1 。这会使得所有记录的该字段都被加1,(删除评论也是)。
请登录后回答