1、文件:app/services/order/StoreCartServices.php
2、方法:modifyCashierCart
public function modifyCashierCart(int $storeId, int $cart_id, int $product_id, string $unique)
{
/** @var StoreProductAttrValueServices $attrService */
$attrService = app()->make(StoreProductAttrValueServices::class);
$stock = $attrService->value(['product_id' => $product_id, 'unique' => $unique, 'type' => 0], 'stock');
if ($stock > 0) {
$this->dao->update($cart_id, ['product_attr_unique' => $unique, 'cart_num' => 1]);
} else {
throw new ValidateException('选择的规格库存不足');
}
}
3、直接替换掉该方法,然后重启swoole
{{item.user_info.nickname ? item.user_info.nickname : item.user_name}}
作者 管理员 企业
{{itemf.name}}
{{itemc.user_info.nickname}}
{{itemc.user_name}}
回复 {{itemc.comment_user_info.nickname}}
{{itemf.name}}