6
0
Fork 0

订单流程优化

release
李静 2022-01-24 14:10:20 +08:00
parent a8a0b12031
commit 768c0b43d4
3 changed files with 11 additions and 2 deletions

View File

@ -146,6 +146,14 @@ class Order extends Model
return $this->belongsTo(User::class, 'user_id');
}
/**
* 下单人信息
*/
public function userInfo()
{
return $this->belongsTo(UserInfo::class, 'user_id', 'user_id');
}
/**
* 使用的优惠券
*

View File

@ -423,8 +423,6 @@ class DistributionPreIncomeJobService
$lastAgent = $agent;
}
$user->incrPreGrowthValue($totalSalesValue, false);
}
DistributionPreIncomeLog::insert($preIncomeLogs);

View File

@ -89,6 +89,9 @@ class PayService
'status' => Order::STATUS_PAID,
]);
// 增加用户预成长值
$payable->userInfo->incrPreGrowthValue($payable->sales_value, false);
DistributionPreIncomeJob::create([
'jobable_id' => $payable->id,
'jobable_type' => $payable->getMorphClass(),