1
This commit is contained in:
parent
229550dde8
commit
0e3499e748
@ -88,6 +88,16 @@ class BaseController {
|
|||||||
return phpcommon\getMondaySeconds($time, $this->timeZone);
|
return phpcommon\getMondaySeconds($time, $this->timeZone);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function _getMonthFirstDaySeconds()
|
||||||
|
{
|
||||||
|
return phpcommon\getThisMonthFirstDaySeconds($this->_getNowTime(), $this->timeZone);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function _getMonthFirstDaySecondsByTime($time)
|
||||||
|
{
|
||||||
|
return phpcommon\getThisMonthFirstDaySeconds($time, $this->timeZone);
|
||||||
|
}
|
||||||
|
|
||||||
public function _inTimeRangeStr($beginTimeStr, $endTimeStr)
|
public function _inTimeRangeStr($beginTimeStr, $endTimeStr)
|
||||||
{
|
{
|
||||||
$beginTimeOffset = myself()->_getDaySecondsOffset(strtotime("2024-6-22 ". $beginTimeStr));
|
$beginTimeOffset = myself()->_getDaySecondsOffset(strtotime("2024-6-22 ". $beginTimeStr));
|
||||||
|
@ -74,6 +74,11 @@ class HashRateShopBuyRecord extends BaseModel
|
|||||||
$cond = " last_buy_time>=${mondaySeconds} AND last_buy_time<=${mondaySeconds} + 3600 * 24 * 7 ";
|
$cond = " last_buy_time>=${mondaySeconds} AND last_buy_time<=${mondaySeconds} + 3600 * 24 * 7 ";
|
||||||
return "CASE WHEN (${cond}) THEN this_week_buy_times + ${goodsNum} ELSE 0 END";
|
return "CASE WHEN (${cond}) THEN this_week_buy_times + ${goodsNum} ELSE 0 END";
|
||||||
},
|
},
|
||||||
|
'this_month_buy_times' => function () use($goodsNum) {
|
||||||
|
$mondaySeconds = myself()->_getMondaySeconds();
|
||||||
|
$cond = " last_buy_time>=${mondaySeconds} AND last_buy_time<=${mondaySeconds} + 3600 * 24 * 7 ";
|
||||||
|
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}';
|
||||||
},
|
},
|
||||||
@ -86,6 +91,7 @@ class HashRateShopBuyRecord extends BaseModel
|
|||||||
'item_id' => $itemId,
|
'item_id' => $itemId,
|
||||||
'this_day_buy_times' => $goodsNum,
|
'this_day_buy_times' => $goodsNum,
|
||||||
'this_week_buy_times' => $goodsNum,
|
'this_week_buy_times' => $goodsNum,
|
||||||
|
'this_month_buy_times' => $goodsNum,
|
||||||
'total_buy_times' => $goodsNum,
|
'total_buy_times' => $goodsNum,
|
||||||
'last_buy_time' => myself()->_getNowTime(),
|
'last_buy_time' => myself()->_getNowTime(),
|
||||||
'createtime' => myself()->_getNowTime(),
|
'createtime' => myself()->_getNowTime(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user