调整批零个人中心业绩显示
parent
24b8ccfcef
commit
a3b43fdf5e
|
|
@ -88,23 +88,23 @@ class Dealer extends Model
|
||||||
*/
|
*/
|
||||||
public function getSaleValuesAttribute()
|
public function getSaleValuesAttribute()
|
||||||
{
|
{
|
||||||
return $this->self_sales_value + $this->team_sales_value;
|
// return $this->self_sales_value + $this->team_sales_value;
|
||||||
// $tz = now();
|
$tz = now();
|
||||||
|
|
||||||
// if ($tz->day >= 20) {
|
if ($tz->day >= 20) {
|
||||||
// // 结算当月20号开始的业绩
|
// 结算当月20号开始的业绩
|
||||||
// $startAt = $tz->copy()->setDay(20)->startOfDay();
|
$startAt = $tz->copy()->setDay(20)->startOfDay();
|
||||||
// } elseif ($tz->day >= 5) {
|
} elseif ($tz->day >= 5) {
|
||||||
// // 结算当月5号开始的的业绩
|
// 结算当月5号开始的的业绩
|
||||||
// $startAt = $tz->copy()->setDay(5)->startOfDay();
|
$startAt = $tz->copy()->setDay(5)->startOfDay();
|
||||||
// } else {
|
} else {
|
||||||
// // 结算上月20号开始的业绩
|
// 结算上月20号开始的业绩
|
||||||
// $startAt = $tz->copy()->subMonthNoOverflow()->setDay(20)->startOfDay();
|
$startAt = $tz->copy()->subMonthNoOverflow()->setDay(20)->startOfDay();
|
||||||
// }
|
}
|
||||||
|
|
||||||
// return DealerPurchaseLog::query()->where('order_completed_at', '>=', $startAt)
|
return DealerPurchaseLog::query()->where('order_completed_at', '>=', $startAt)
|
||||||
// ->where('path', 'like', "{$this->userInfo->full_path}%")
|
->where('path', 'like', "{$this->userInfo->full_path}%")
|
||||||
// ->sum('total_amount');
|
->sum('total_amount');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue