xiaogang 4 år sedan
förälder
incheckning
6b6dce4233
1 ändrade filer med 1 tillägg och 1 borttagningar
  1. 1 1
      app/Services/NoticeService.php

+ 1 - 1
app/Services/NoticeService.php

xqd
@@ -54,7 +54,7 @@ class NoticeService
         $query = $query->toArray();
         foreach ($query['data'] as $k=>$v){
             $query['data'][$k]['distance'] = 0;  //计算距离
-            $query['data'][$k]['age'] = birthday($v['birthday']);  //计算距离
+            $query['data'][$k]['age'] = !empty($v['birthday'])?birthday($v['birthday']):0;  //计算距离
 
         }
         return $query;