|
|
@@ -753,7 +753,7 @@ class UserThirdRepository extends BaseRepository
|
|
753
|
753
|
/**
|
|
754
|
754
|
* 添加预估积分记录
|
|
755
|
755
|
*/
|
|
756
|
|
- public function yuguJifen($order_id,$price,$user_id,$order_sn,$type_shop)
|
|
|
756
|
+ public function yuguJifen($order_id,$price,$user_id,$order_sn,$type_shop, $payPrice = 0.00)
|
|
757
|
757
|
{
|
|
758
|
758
|
if (empty($user_id)) {
|
|
759
|
759
|
Db::name('log')->insert(['data' => "type_shop:{$type_shop}, $order_sn, $order_sn, 赠送积分, 不存在用户ID"]);
|
|
|
@@ -772,18 +772,20 @@ class UserThirdRepository extends BaseRepository
|
|
772
|
772
|
Db::name('log')->insert(['data' => "type_shop:{$type_shop}, $order_sn, $order_sn, 赠送积分, $price"]);
|
|
773
|
773
|
|
|
774
|
774
|
try {
|
|
775
|
|
- // 所有第三方所下订单,消费者获得 提现额度
|
|
776
|
|
- $withdrawalLimit = bcmul($price, CommonEnum::WITHDRAWAL_LIMIT_RATIO, CommonEnum::DECIMAL_PLACES_OF_THE_AMOUNT);
|
|
777
|
|
- /** @var UserWithdrawalLimitRecordRepository $userWithdrawalLimitRecordRepository */
|
|
778
|
|
- $userWithdrawalLimitRecordRepository = app()->make(UserWithdrawalLimitRecordRepository::class);
|
|
779
|
|
- $userWithdrawalLimitRecordRepository->addUserWithdrawalLimitRecord(
|
|
780
|
|
- (int)$user_id,
|
|
781
|
|
- UserWithdrawalLimitRecordEnum::PM['INCOME']['code'],
|
|
782
|
|
- (float)$withdrawalLimit,
|
|
783
|
|
- (int)$type_shop,
|
|
784
|
|
- $order_sn,
|
|
785
|
|
- '消费获得提现额度'
|
|
786
|
|
- );
|
|
|
775
|
+ if ($payPrice > 0.00) {
|
|
|
776
|
+ // 所有第三方所下订单,消费者获得 提现额度
|
|
|
777
|
+ $withdrawalLimit = bcmul($payPrice, CommonEnum::WITHDRAWAL_LIMIT_RATIO, CommonEnum::DECIMAL_PLACES_OF_THE_AMOUNT);
|
|
|
778
|
+ /** @var UserWithdrawalLimitRecordRepository $userWithdrawalLimitRecordRepository */
|
|
|
779
|
+ $userWithdrawalLimitRecordRepository = app()->make(UserWithdrawalLimitRecordRepository::class);
|
|
|
780
|
+ $userWithdrawalLimitRecordRepository->addUserWithdrawalLimitRecord(
|
|
|
781
|
+ (int)$user_id,
|
|
|
782
|
+ UserWithdrawalLimitRecordEnum::PM['INCOME']['code'],
|
|
|
783
|
+ (float)$withdrawalLimit,
|
|
|
784
|
+ (int)$type_shop,
|
|
|
785
|
+ $order_sn,
|
|
|
786
|
+ '消费获得提现额度'
|
|
|
787
|
+ );
|
|
|
788
|
+ }
|
|
787
|
789
|
|
|
788
|
790
|
//更新用户积分
|
|
789
|
791
|
|