mirror of
https://github.com/ProxyPanel/ProxyPanel.git
synced 2026-04-07 04:59:36 +00:00
Fix 每日&返利任务错误修正
1. 修复每日任务-重置流量中订单关系未正确使用的错误; 2. 修复商品返利建立返利单时,未正确使用上下级关系与数据名称错误的问题;
This commit is contained in:
@@ -98,7 +98,7 @@ class DailyJob extends Command
|
||||
->where('expired_at', '>', date('Y-m-d'))
|
||||
->where('reset_time', '<=', date('Y-m-d'))
|
||||
->whereNotNull('reset_time')
|
||||
->with('order')->whereHas('order')
|
||||
->with('orders')->whereHas('orders')
|
||||
->chunk(config('tasks.chunk'), function ($users) {
|
||||
foreach ($users as $user) {
|
||||
$order = $user->orders()->activePlan()->first(); // 取出用户正在使用的套餐
|
||||
@@ -107,7 +107,7 @@ class DailyJob extends Command
|
||||
continue;
|
||||
}
|
||||
|
||||
$user->order()->activePackage()->update(['is_expire' => 1]); // 过期生效中的加油包
|
||||
$user->orders()->activePackage()->update(['is_expire' => 1]); // 过期生效中的加油包
|
||||
|
||||
$oldData = $user->transfer_enable;
|
||||
// 重置流量与重置日期
|
||||
|
||||
@@ -168,9 +168,9 @@ class OrderService
|
||||
}
|
||||
// 按照返利模式进行返利判断
|
||||
if ($referralType === '2' || $referral) {
|
||||
return $user->commissionLogs()
|
||||
return $inviter->commissionLogs()
|
||||
->create([
|
||||
'inviterId' => $inviter->id,
|
||||
'invitee_id' => $user->id,
|
||||
'order_id' => self::$order->id,
|
||||
'amount' => self::$order->amount,
|
||||
'commission' => self::$order->amount * sysConfig('referral_percent'),
|
||||
|
||||
Reference in New Issue
Block a user