Bläddra i källkod

管理端导出PDF报错处理

kevin_zhangl 3 år sedan
förälder
incheckning
7289716725
1 ändrade filer med 10 tillägg och 2 borttagningar
  1. 10 2
      backendApi/modules/v1/controllers/BonusController.php

+ 10 - 2
backendApi/modules/v1/controllers/BonusController.php

@@ -41,6 +41,7 @@ use backendApi\modules\v1\models\lists\bonus\TraceUpYjList;
 use backendApi\modules\v1\models\lists\bonus\UserPerfList;
 use common\helpers\Cache;
 use common\helpers\Date;
+use common\helpers\LoggerTool;
 use common\helpers\Tool;
 use common\helpers\user\Info;
 use common\helpers\user\Perf;
@@ -969,8 +970,15 @@ class BonusController extends BaseController {
             $condition .= ' AND CB.PERIOD_NUM=:PERIOD_NUM';
             $params[':PERIOD_NUM'] = $periodNum;
         }
-        $listObj = new PeriodBonusList();
-        $data = $listObj->getList(['condition'=>$condition, 'params'=>$params, 'others'=>['yearMonth'=>$yearMonth]]);
+
+        try {
+            $listObj = new PeriodBonusList();
+            $data = $listObj->getList(['condition'=>$condition, 'params'=>$params, 'others'=>['yearMonth'=>$yearMonth]]);
+        } catch (Exception $e) {
+            LoggerTool::info([$e->getFile(), $e->getLine(), $e->getMessage()]);
+            return null;
+        }
+
         return $data;
     }