xiaogang 4 年之前
父节点
当前提交
6b6dce4233
共有 1 个文件被更改,包括 1 次插入1 次删除
  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;