Gorden il y a 1 mois
Parent
commit
5ef34a2dc8
2 fichiers modifiés avec 12 ajouts et 5 suppressions
  1. 6 4
      app/admin/controller/notify/RechargeController.php
  2. 6 1
      app/functions.php

+ 6 - 4
app/admin/controller/notify/RechargeController.php

@@ -67,11 +67,13 @@ class RechargeController
 
             return $result;
         } catch (BusinessException $e) {
+            dump($e->getMessage());
             _syslog("APP充值", "APP充值失败", $data, $data, 1001);
-            return json_fail("处理失败");
+            return json_fail("处理失败3");
         } catch (\Exception $e) {
+            dump($e->getMessage());
             _syslog("APP充值", "APP充值失败", $data, $data, 1001);
-            return json_fail("处理失败");
+            return json_fail("处理失败4");
         }
 
 //    public function paySuccess($id)
@@ -173,12 +175,12 @@ class RechargeController
             dump($e->getMessage());
             Db::rollBack();
 
-            throw new BusinessException("处理失败");
+            throw new BusinessException("处理失败1");
 //            return json_fail('处理失败');
         } catch (\Exception $e) {
             dump($e->getMessage());
             Db::rollBack();
-            throw new BusinessException("处理失败");
+            throw new BusinessException("处理失败2");
 //            return json_fail('处理失败');
         }
     }

+ 6 - 1
app/functions.php

@@ -88,7 +88,12 @@ if (!function_exists('month_12')) {
 if (!function_exists('_syslog')) {
     function _syslog($name, $operation, $operationData = false, $requestParams = false, $adminId = false)
     {
-        $logAdminId = $adminId ? $adminId : \Tinywan\Jwt\JwtToken::getCurrentId();
+        try {
+            $adminId = $adminId ? $adminId : \Tinywan\Jwt\JwtToken::getCurrentId();
+        } catch (\Exception $e) {
+            $adminId = 1001;
+        }
+        $logAdminId = $adminId;
         $model = new \app\model\SysLog();
         $model->log_admin_id = $logAdminId;
         $model->log_name = $name;