mirror of
https://gitee.com/zongzhige/shopxo.git
synced 2024-12-01 03:18:33 +08:00
商品基础数据更新新增钩子
This commit is contained in:
parent
65da8bb3bf
commit
fb034fbcd7
@ -1335,11 +1335,24 @@ class GoodsService
|
||||
|
||||
// 更新商品表
|
||||
$data['upd_time'] = time();
|
||||
if(Db::name('Goods')->where(['id'=>$goods_id])->update($data))
|
||||
if(Db::name('Goods')->where(['id'=>$goods_id])->update($data) === false)
|
||||
{
|
||||
return DataReturn('操作成功', 0);
|
||||
return DataReturn('商品基础更新失败', -1);
|
||||
}
|
||||
return DataReturn('操作失败', 0);
|
||||
|
||||
// 商品基础数据更新钩子
|
||||
$hook_name = 'plugins_service_goods_base_update';
|
||||
$ret = EventReturnHandle(MyEventTrigger($hook_name, [
|
||||
'hook_name' => $hook_name,
|
||||
'is_backend' => true,
|
||||
'goods_id' => $goods_id
|
||||
]));
|
||||
if(isset($ret['code']) && $ret['code'] != 0)
|
||||
{
|
||||
return $ret;
|
||||
}
|
||||
|
||||
return DataReturn('操作成功', 0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user