订单流程优化
parent
a8a0b12031
commit
768c0b43d4
|
|
@ -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');
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用的优惠券
|
||||
*
|
||||
|
|
|
|||
|
|
@ -423,8 +423,6 @@ class DistributionPreIncomeJobService
|
|||
|
||||
$lastAgent = $agent;
|
||||
}
|
||||
|
||||
$user->incrPreGrowthValue($totalSalesValue, false);
|
||||
}
|
||||
|
||||
DistributionPreIncomeLog::insert($preIncomeLogs);
|
||||
|
|
|
|||
|
|
@ -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(),
|
||||
|
|
|
|||
Loading…
Reference in New Issue