Commit c465b307 authored by shiyu's avatar shiyu

编辑商品删除图片

parent 333054d4
...@@ -79,7 +79,6 @@ public class AdminGoodsService { ...@@ -79,7 +79,6 @@ public class AdminGoodsService {
* 只能删除三个表旧的数据,然后添加新的数据。 但是这里又会引入新的问题,就是存在订单商品货品ID指向了失效的商品货品表。 * 只能删除三个表旧的数据,然后添加新的数据。 但是这里又会引入新的问题,就是存在订单商品货品ID指向了失效的商品货品表。
* 因此这里会拒绝管理员编辑商品,如果订单或购物车中存在商品。 所以这里可能需要重新设计。 * 因此这里会拒绝管理员编辑商品,如果订单或购物车中存在商品。 所以这里可能需要重新设计。
*/ */
@Transactional
public Object update(Item item) { public Object update(Item item) {
Object error = validate(item); Object error = validate(item);
if (error != null) { if (error != null) {
......
...@@ -118,7 +118,8 @@ public class ItemService { ...@@ -118,7 +118,8 @@ public class ItemService {
public int updateById(Item item) { public int updateById(Item item) {
item.setUpdateTime(new Date()); item.setUpdateTime(new Date());
return itemMapper.updateByPrimaryKeySelective(item); // return itemMapper.updateByPrimaryKeySelective(item);
return itemMapper.updateByPrimaryKey(item);
} }
public void deleteById(Long id) { public void deleteById(Long id) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment