فهرست منبع

更新生日问题

shish 7 ماه پیش
والد
کامیت
cb5952bba3
1فایلهای تغییر یافته به همراه3 افزوده شده و 4 حذف شده
  1. 3 4
      app-mall/controllers/UserController.php

+ 3 - 4
app-mall/controllers/UserController.php

@@ -127,7 +127,7 @@ class UserController extends BaseController
                 $userId = $this->userId;
                 $birthdayMonth = $user->birthdayMonth ?? 0;
                 $birthdayDate = $user->birthdayDate ?? 0;
-                if ($lunar == 1) {
+                if ($lunar == 1 && $birthdayMonth > 0 && $birthdayDate > 0) {
                     try {
                         //农历转阳历,有多处使用,需要同步修改,关键词change_my_birthday
                         $calendar = new Calendar();
@@ -141,7 +141,6 @@ class UserController extends BaseController
                     } catch (\InvalidArgumentException $e) {
                         $msg = $e->getMessage();
                         noticeUtil::push("更新生日出错了呢,userId:" . $userId . ' ' . $msg, '15280215347');
-                        $birthday = '0000-00-00 00:00:00';
                     }
                 } else {
                     $birthday = date("Y") . '-' . $birthdayMonth . '-' . $birthdayDate;
@@ -163,13 +162,13 @@ class UserController extends BaseController
 
         // 补充店铺信息
         $shop = [];
-        if(!empty($this->shop)){
+        if (!empty($this->shop)) {
             $intraCityRet = ShopClass::hasIntraCity($this->shop);
             $shop['openIntraCity'] = $intraCityRet['openIntraCity'];
             $shop['hcFreeKm'] = $intraCityRet['hcFreeKm'];
             $shop['hcMap'] = $intraCityRet['hcMap'];
         }
-        
+
         util::success(['info' => $user, 'shop' => $shop]);
     }