...
This commit is contained in:
parent
5b7cb8e1fb
commit
d33fea4988
@ -444,6 +444,7 @@ class DailySelectionGoods(object):
|
||||
['weight', 0, '权重'],
|
||||
['discount', 0, '折扣'],
|
||||
['price', 0, '价格'],
|
||||
['pending', 0, '购买中...'],
|
||||
]
|
||||
|
||||
class Mission(object):
|
||||
|
@ -847,12 +847,13 @@ class ShopController extends BaseAuthedController
|
||||
for ($i = 1; $i <= 6; $i++) {
|
||||
$goodsList[$i] = mt\Dailyselection::get($selection['grid_' . $i]);
|
||||
$goodsList[$i]['count'] = $selection['count_' . $i];
|
||||
$goodsList[$i]['pending'] = $this->checkPendingBuyGoodsDS($address, $goodsList[$i]['goods_id'], $selection['idx'], $i);
|
||||
}
|
||||
|
||||
$count = $this->countTodayRefreshTimes($address);
|
||||
$costs = mt\Parameter::getByName('daily_selection_refresh_cost');
|
||||
$arrCosts = explode('|', $costs['param_value']);
|
||||
$cost = $arrCosts[$count];
|
||||
$cost = $count < count($arrCosts) ? $arrCosts[$count] : null;
|
||||
|
||||
$this->_rspData(
|
||||
array(
|
||||
@ -882,7 +883,11 @@ class ShopController extends BaseAuthedController
|
||||
$row = mt\ShopGoods::get($id);
|
||||
|
||||
$goods_id = $row['goods_id'];
|
||||
|
||||
$pending = $this->checkPendingBuyGoodsNormal($address, $goods_id, $row['shop_id'], $id);
|
||||
if ($pending) {
|
||||
$this->_rspErr(1, 'pending');
|
||||
return;
|
||||
}
|
||||
$desired_token_type = $row['token_type'];
|
||||
$check_token_type = splitStr1($desired_token_type);
|
||||
$token_pos = array_search($token_type, $check_token_type, true);
|
||||
@ -1130,6 +1135,12 @@ class ShopController extends BaseAuthedController
|
||||
|
||||
$goods = mt\Dailyselection::get($sel_id);
|
||||
|
||||
$pending = $this->checkPendingBuyGoodsDS($address, $goods['goods_id'], $idx, $grid);
|
||||
if ($pending) {
|
||||
$this->_rspErr(2, 'pending');
|
||||
return;
|
||||
}
|
||||
|
||||
$price = $this->normalizeWeb3Price($goods['price'] * $count);
|
||||
$item_id = $goods['goods_id'];
|
||||
$item_count = $goods['goods_num'] * $count;
|
||||
@ -1557,6 +1568,36 @@ class ShopController extends BaseAuthedController
|
||||
return 0;
|
||||
}
|
||||
|
||||
private function checkPendingBuyGoodsDS($address, $goodsId, $idx, $grid)
|
||||
{
|
||||
$self = myself();
|
||||
if (!$self) return;
|
||||
|
||||
$conn = $self->_getMysql('');
|
||||
|
||||
$rows = SqlHelper::select(
|
||||
$conn,
|
||||
't_bc_order',
|
||||
array('ext_data'),
|
||||
array(
|
||||
'address' => $address,
|
||||
'item_id' => $goodsId,
|
||||
'status' => 0,
|
||||
)
|
||||
);
|
||||
foreach ($rows as $row) {
|
||||
$extData = json_decode($row['ext_data'], true);
|
||||
if ($extData['mode'] == SHOP_BUY_MODE_DAILY_SELECTION) {
|
||||
if ($extData['idx'] == $idx) {
|
||||
if ($extData['grid'] == $grid) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
private function outsideBuy($shopId, $itemId, $itemNum, $costItemId)
|
||||
{
|
||||
$propertyChgService = new services\PropertyChgService();
|
||||
|
Loading…
x
Reference in New Issue
Block a user