feat: 优化 MerchantLogic.php 中 goods_id 对应的 nums 数据赋值逻辑,增加可空默认值

This commit is contained in:
mkm 2024-05-24 16:47:21 +08:00
parent a96f6c8d41
commit a3531fd253

View File

@ -268,7 +268,7 @@ class MerchantLogic extends BaseLogic
$data = [
'mer_id' => $params['mer_id'],
'goods_id' => $v['goods_id'],
'nums' => $v['nums']
'nums' => $v['nums']??0
];
$has = Db::name('merchant_bind_goods')->where('mer_id', $params['mer_id'])->where('goods_id', $v['goods_id'])->findOrEmpty();
if (!empty($has)) {