feat: #10000 日志记录修改

This commit is contained in:
赵世界 2022-08-09 20:40:39 +08:00
parent b20abf00d6
commit 5475a468af

View File

@ -92,10 +92,15 @@ class GoodsSkusController extends Controller
$this->addLog($id, 'update');
// 商品更新
$goods = Goods::query()->find($sku->goods_id);
$this->log = new LogModel([
'module' => 'goods',
'action' => $request->getMethod(),
'target_type' => 'goods',
]);
$this->setBeforeUpdate($goods->toArray());
$goods->update($request->goods);
$this->setAfterUpdate($goods->toArray());
$this->addLog($sku->goods_id, 'update', 'goods');
$this->addLog($sku->goods_id, 'update');
DB::commit();
} catch (\Exception $exception) {
DB::rollBack();