1
This commit is contained in:
parent
418c53bf1b
commit
24bcbe531a
@ -8,6 +8,7 @@ require_once('mt/HashRateShop.php');
|
||||
require_once('mt/Item.php');
|
||||
|
||||
require_once('models/HashRate.php');
|
||||
require_once('models/HashRateShopBuyRecord.php');
|
||||
|
||||
use phpcommon\SqlHelper;
|
||||
|
||||
@ -82,14 +83,15 @@ class HashRateShopController extends BaseAuthedController {
|
||||
return;
|
||||
}
|
||||
models\HashRate::decMyCurrentHashRate($price * $goodsNum);
|
||||
HashRateShopBuyRecord::add($goodsMeta['goods_id'], $goodsNum, $goodsMeta['type']);
|
||||
models\HashRateShopBuyRecord::add($goodsMeta['id'], $goodsNum, $goodsMeta['type']);
|
||||
/*
|
||||
for ($i = 0; $i < $goodsNum; $i++) {
|
||||
$this->internalAddItem($awardService,
|
||||
$propertyChgService,
|
||||
$itemMeta,
|
||||
$goodsMeta['item_num']
|
||||
);
|
||||
}
|
||||
}*/
|
||||
$propertyChgService->addUserChg();
|
||||
$this->_rspData(
|
||||
array(
|
||||
|
@ -139,6 +139,8 @@ class HashRate extends BaseModel
|
||||
array(
|
||||
'account_id' => myself()->_getAccountId(),
|
||||
'period' => $currentPeriod['id'],
|
||||
),
|
||||
array(
|
||||
'reward' => function () use($val) {
|
||||
return "GREATEST(0, reward - ${val})";
|
||||
},
|
||||
|
@ -84,7 +84,7 @@ class HashRateShopBuyRecord extends BaseModel
|
||||
return "CASE WHEN (${cond}) THEN this_month_buy_times + ${goodsNum} ELSE 0 END";
|
||||
},
|
||||
'total_buy_times' => function () use($goodsNum) {
|
||||
return 'total_buy_times + ${goodsNum}';
|
||||
return "total_buy_times + ${goodsNum}";
|
||||
},
|
||||
'last_buy_time' => myself()->_getNowTime(),
|
||||
'modifytime' => myself()->_getNowTime(),
|
||||
|
@ -74,7 +74,7 @@ class HashRateShopService {
|
||||
$errMsg = '';
|
||||
$buyRecordHash = HashRateShopBuyRecord::allToHash();
|
||||
$boughtTimes = 1;
|
||||
$goodsId = $goodsMeta['goods_id'];
|
||||
$goodsId = $goodsMeta['id'];
|
||||
{
|
||||
switch ($goodsMeta['limit_type']) {
|
||||
case mt\HashRateShop::DAILY_BUY_LIMIT: {
|
||||
|
Loading…
x
Reference in New Issue
Block a user