更新发起转售判断条件

This commit is contained in:
yaooo 2023-08-15 17:14:23 +08:00
parent 0d43115082
commit d5e752f38e

View File

@ -593,10 +593,10 @@ class CommunityRepository extends BaseRepository
continue; continue;
} }
$purchaseRecord = PurchaseRecord::where('unique', $value['product_attr_unique'])->find(); $purchaseRecord = PurchaseRecord::where('unique', $value['product_attr_unique'])->find();
$exist = Resale::where('purchase_record_id', $purchaseRecord['id'])->find(); // $exist = Resale::where('purchase_record_id', $purchaseRecord['id'])->find();
if ($exist) { // if ($exist) {
throw new ValidateException('已发起转售'); // throw new ValidateException('已发起转售');
} // }
if (empty($purchaseRecord) || ($purchaseRecord['number'] - $purchaseRecord['sales_volume']) <= 0) { if (empty($purchaseRecord) || ($purchaseRecord['number'] - $purchaseRecord['sales_volume']) <= 0) {
throw new ValidateException('进货记录不存在或已售罄'); throw new ValidateException('进货记录不存在或已售罄');
} }