update (['stock' => $sku->stock - $amount]) 最后不也是生成 SQL 语句直接操作吗?
update(['stock' => $sku->stock - $amount])
和
$this->newQuery()->where('id', $this->id)->where('stock', '>=', $amount)->decrement('stock', $amount);
的区别是什么?为什么下面这个可以用于高并发场合?
推荐文章: