1
This commit is contained in:
parent
afadd312c9
commit
ab80faccc6
@ -25,7 +25,7 @@ class HashRateShop {
|
|||||||
|
|
||||||
public static function all()
|
public static function all()
|
||||||
{
|
{
|
||||||
return self::$metaList;
|
return self::getMetaList();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static $metaList;
|
protected static $metaList;
|
||||||
|
@ -25,31 +25,33 @@ class HashRateShopService {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$goodsDto = array(
|
$goodsDto = array(
|
||||||
'goods_id' => $goodsMeta['goods_id'],
|
'goods_id' => $goodsMeta['id'],
|
||||||
'goods_meta' => self::goodsMetaToInfo($goodsMeta),
|
'item_id' => $goodsMeta['type'],
|
||||||
'bought_times' => 0,
|
'item_num' => $goodsMeta['item_num'],
|
||||||
'free_num' => 0,
|
'purchased_num' => 0,
|
||||||
|
'max_num' => 0,
|
||||||
|
'count_down' => 0,
|
||||||
);
|
);
|
||||||
array_push($goodsList, $goodsDto);
|
array_push($goodsList, $goodsDto);
|
||||||
switch ($goodsMeta['limit_type']) {
|
switch ($goodsMeta['limit_type']) {
|
||||||
case mt\HashRateShop::DAILY_BUY_LIMIT: {
|
case mt\HashRateShop::DAILY_BUY_LIMIT: {
|
||||||
$buyRecord = getXVal($buyRecordHash, $goodsMeta['goods_id']);
|
$buyRecord = getXVal($buyRecordHash, $goodsMeta['id']);
|
||||||
$goodsDto['bought_times'] = $buyRecord ? $buyRecord['this_day_buy_times'] : 0;
|
$goodsDto['purchased_num'] = $buyRecord ? $buyRecord['this_day_buy_times'] : 0;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case mt\HashRateShop::WEEKLY_BUY_LIMIT: {
|
case mt\HashRateShop::WEEKLY_BUY_LIMIT: {
|
||||||
$buyRecord = getXVal($buyRecordHash, $goodsMeta['goods_id']);
|
$buyRecord = getXVal($buyRecordHash, $goodsMeta['id']);
|
||||||
$goodsDto['bought_times'] = $buyRecord ? $buyRecord['this_week_buy_times'] : 0;
|
$goodsDto['purchased_num'] = $buyRecord ? $buyRecord['this_week_buy_times'] : 0;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case mt\HashRateShop::MONTH_BUY_LIMIT: {
|
case mt\HashRateShop::MONTH_BUY_LIMIT: {
|
||||||
$buyRecord = getXVal($buyRecordHash, $goodsMeta['goods_id']);
|
$buyRecord = getXVal($buyRecordHash, $goodsMeta['id']);
|
||||||
$goodsDto['bought_times'] = $buyRecord ? $buyRecord['this_week_buy_times'] : 0;
|
$goodsDto['purchased_num'] = $buyRecord ? $buyRecord['this_week_buy_times'] : 0;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case mt\HashRateShop::TOTAL_BUY_LIMIT: {
|
case mt\HashRateShop::TOTAL_BUY_LIMIT: {
|
||||||
$buyRecord = getXVal($buyRecordHash, $goodsMeta['goods_id']);
|
$buyRecord = getXVal($buyRecordHash, $goodsMeta['id']);
|
||||||
$goodsDto['bought_times'] = $buyRecord ? $buyRecord['total_buy_times'] : 0;
|
$goodsDto['purchased_num'] = $buyRecord ? $buyRecord['total_buy_times'] : 0;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default: {
|
default: {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user