feat(dashboard): 从专业财富观角度重构升级后台收益与分成统计仪表盘
这个提交包含在:
@@ -14,10 +14,16 @@ class RateService
|
||||
public function currentRate()
|
||||
{
|
||||
$latest = RateLog::order('id', 'desc')->find();
|
||||
if ($latest && (float) $latest->rate > 0) {
|
||||
if ($latest) {
|
||||
return (float) $latest->rate;
|
||||
}
|
||||
return $this->calcRate($this->countN());
|
||||
$cached = cache('partner_madow_current_rate');
|
||||
if ($cached !== null && $cached !== false) {
|
||||
return (float) $cached;
|
||||
}
|
||||
$rate = $this->calcRate($this->countN());
|
||||
cache('partner_madow_current_rate', $rate, 300);
|
||||
return $rate;
|
||||
}
|
||||
|
||||
public function calcRate($n = null)
|
||||
@@ -48,9 +54,12 @@ class RateService
|
||||
], $extra);
|
||||
if ($row) {
|
||||
$row->save($data);
|
||||
cache('partner_madow_current_rate', (float) $rate, 300);
|
||||
return $row;
|
||||
}
|
||||
return RateLog::create($data);
|
||||
$created = RateLog::create($data);
|
||||
cache('partner_madow_current_rate', (float) $rate, 300);
|
||||
return $created;
|
||||
}
|
||||
|
||||
public function qualifiedOrderQuery($start = null, $end = null)
|
||||
|
||||
在新工单中引用
屏蔽一个用户