Merge pull request '更新' (#130) from dev into master

Reviewed-on: #130
This commit is contained in:
mkm 2024-01-23 13:22:32 +08:00
commit b624d3daef
2 changed files with 3 additions and 3 deletions

View File

@ -119,7 +119,7 @@ class StoreActivityDao extends BaseDao
public function canBuy($userId, $productId)
{
$activityId = Db::name('cloud_product')->where('product_id', $productId)->value('activity_id');
$find = Db::name('store_activity_order_product')->where('user_id', $userId)->where('product_id',$productId)->where('status', 1)->find();
$find = Db::name('store_activity_order_product')->where('user_id', $userId)->where('status', 1)->find();
$data=['activityId'=>$activityId,'is_true'=>true];
if ($find && $activityId == 2) {
$data['is_true']=false;

View File

@ -105,12 +105,12 @@ class StoreOrderCreateRepository extends StoreOrderRepository
if($source==103){
$canBuy = (new StoreActivityDao())->canBuy($cart['uid'], $cart['product_id']);
if ($canBuy['is_true']==false) {
throw new ValidateException('活动商品限购13个');
throw new ValidateException('活动商品限购1个');
}
if ($canBuy['activityId']== 2) {
$activityProductCount += $cart['cart_num'];
if ($activityProductCount > 1){
throw new ValidateException('活动商品限购12个');
throw new ValidateException('活动商品限购1个');
}
}
}