ソースを参照

增加接口返回结果的数组判断

sandm 2 年 前
コミット
93c21317d6
1 ファイル変更1 行追加1 行削除
  1. 1 1
      app/common.php

+ 1 - 1
app/common.php

@@ -524,7 +524,7 @@ function formatDateByMonth($date1,$date2,$data = []){
     for($sTime; $sTime <= $eTime;  $sTime = strtotime('+1 month', $sTime)){
         $month_arr[date('Ym',$sTime)] = date('Y-m',$sTime); // 取得递增月;
     }
-    if(count($data) > 0){
+    if(is_array($data) && count($data) > 0){
         foreach ($data as $item) {
             if(array_key_exists($item['aae003'],$month_arr)){
                 $month_arr[$item['aae003']] .= "<span style='color:green'>已缴费</span>";