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