wesmiler 3 недель назад
Родитель
Сommit
60da2e81ca
2 измененных файлов с 5 добавлено и 6 удалено
  1. 0 5
      app/Services/Api/SettleService.php
  2. 5 1
      app/Services/PaymentService.php

+ 0 - 5
app/Services/Api/SettleService.php

@@ -226,7 +226,6 @@ class SettleService extends BaseService
                     'status'=>1
                 ];
             }
-
         }
 
         if($logs && !$this->model->insert($logs)){
@@ -235,10 +234,6 @@ class SettleService extends BaseService
         }
 
         $result = ['user_id'=>$userId,'total'=> $money,'bonus'=>$bonus,'parent_id'=>$parentId,'oneId'=>$parentOneId,'oneBonus'=>$oneBonus,'twoId'=>$parentTwoId,'twoBonus'=>$twoBonus];
-        if(env('APP_DEBUG')){
-            RedisService::set("caches:settle:{$orderNo}:agent_{$userId}", $result, 7200);
-        }
-
         return $result;
     }
 

+ 5 - 1
app/Services/PaymentService.php

@@ -795,11 +795,15 @@ class PaymentService extends BaseService
         if($status == 4 && $amount>0)
         {
             // 代理佣金结算
-            if (SettleService::make()->agentBonus($orderUserId, $amount, $orderInfo, $parentId) < 0) {
+            $result = SettleService::make()->agentBonus($orderUserId, $amount, $orderInfo, $parentId);
+            if ($result<0) {
                 DB::rollBack();
                 $this->error = SettleService::make()->getError();
+                $this->saveLog("caches:settle:{$out_trade_num}:agent_{$orderUserId}_error",SettleService::make()->getError());
                 return false;
             }
+            $this->saveLog("caches:settle:{$out_trade_num}:agent_{$orderUserId}",$result);
+
         }
 
         DB::commit();