...
This commit is contained in:
parent
1200480a64
commit
d7e8d22e2a
@ -855,13 +855,13 @@ class ShopController extends BaseAuthedController
|
||||
$count = $this->countFreeBuyTimes($row);
|
||||
if ($count < $row['free_num']) {
|
||||
$isFreeBuy = true;
|
||||
} else {
|
||||
$this->_rspErr(1, "free_num parameter error, free_num: {$row['free_num']}");
|
||||
}
|
||||
}
|
||||
if (!$isFreeBuy) {
|
||||
if (!in_array($token_type, $check_token_type)) {
|
||||
$this->_rspErr(1, "token_type parameter error, desired_token_type: {$desired_token_type}");
|
||||
return;
|
||||
}
|
||||
} else if (!in_array($token_type, $check_token_type)) {
|
||||
$this->_rspErr(1, "token_type parameter error, desired_token_type: {$desired_token_type}");
|
||||
return;
|
||||
}
|
||||
|
||||
if ($goods_num > $row['max_amount']) {
|
||||
@ -1164,6 +1164,7 @@ class ShopController extends BaseAuthedController
|
||||
$this->_rspErr(2, 'id is invalid');
|
||||
return;
|
||||
}
|
||||
$meta = mt\Item::get($shop['goods_id']);
|
||||
$cost = $shop['price'] * $num;
|
||||
$isFreeBuy = false;
|
||||
if (!empty($shop['free_type'])) {
|
||||
@ -1206,7 +1207,7 @@ class ShopController extends BaseAuthedController
|
||||
array_push($result, $record[$key]);
|
||||
}
|
||||
if ($isFreeBuy) {
|
||||
$this->addFreeBuyRecord($shop);
|
||||
$this->addFreeBuyRecord($shop);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user