Răsfoiți Sursa

Merge branch 'master' into dev

shish 11 luni în urmă
părinte
comite
60b62f1745

+ 0 - 1
app-mall/controllers/ShopController.php

@@ -38,7 +38,6 @@ class ShopController extends BaseController
         $custom = [];
         if (!empty($user)) {
             if (empty($hdId)) {
-                $shop = $this->shop;
                 $respond = CustomClass::buildRelation($shop, $user);
                 $hd = $respond['hd'];
                 $custom = $respond['custom'];

+ 43 - 7
app-mall/controllers/UserController.php

@@ -11,6 +11,7 @@ use bizMall\user\services\UserService;
 use common\components\dict;
 use common\components\imgUtil;
 use common\components\jwt;
+use common\components\noticeUtil;
 use common\components\stringUtil;
 use Yii;
 use common\components\util;
@@ -67,27 +68,27 @@ class UserController extends BaseController
             util::fail('农历没有31号');
         }
         $user = $this->user;
+        $userId = $this->userId;
         if ($user->birthdaySet == 1) {
             util::fail('你已经设置过了');
         }
-
-        $calendar = new Calendar();
         if ($lunar == 1) {
             try {
+                //农历转阳历,有多处使用,需要同步修改,关键词change_my_birthday
+                $calendar = new Calendar();
                 $result = $calendar->lunar(date("Y"), $birthdayMonth, $birthdayDate);
+                $month = $result['gregorian_month'] ?? 1;
+                $date = $result['gregorian_day'] ?? 1;
+                $birthday = date("Y") . '-' . $month . '-' . $date;
             } catch (\InvalidArgumentException $e) {
                 $msg = $e->getMessage();
+                $birthday = '0000-00-00 00:00:00';
                 util::fail($msg);
             }
-            $month = $result['gregorian_month'] ?? 1;
-            $date = $result['gregorian_day'] ?? 1;
-            $birthday = date("Y") . '-' . $month . '-' . $date;
         } else {
             $birthday = date("Y") . '-' . $birthdayMonth . '-' . $birthdayDate;
         }
         $birthdayTime = strtotime($birthday);
-
-
         $user->lunar = $lunar;
         $user->birthdayDate = $birthdayDate;
         $user->birthdayMonth = $birthdayMonth;
@@ -124,6 +125,41 @@ class UserController extends BaseController
             $user['smallAvatar'] = $smallAvatar;
             $user['shortAvatar'] = $shortAvatar;
         }
+
+        $birthday = $user->birthday ?? '';
+        //如果当年的生日时间没有更新,则需要给更新
+        $year = date("Y", strtotime($birthday));
+        $thisYear = date("Y");
+        if ($year != $thisYear) {
+            $lunar = $user->lunar ?? 0;
+            $userId = $this->userId;
+            $birthdayMonth = $user->birthdayMonth ?? 0;
+            $birthdayDate = $user->birthdayDate ?? 0;
+            if ($lunar == 1) {
+                try {
+                    //农历转阳历,有多处使用,需要同步修改,关键词change_my_birthday
+                    $calendar = new Calendar();
+                    $result = $calendar->lunar(date("Y"), $birthdayMonth, $birthdayDate);
+                    $month = $result['gregorian_month'] ?? 1;
+                    $date = $result['gregorian_day'] ?? 1;
+                    $birthday = date("Y") . '-' . $month . '-' . $date;
+                    $user->birthday = $birthday;
+                    $user->save();
+                    CustomClass::updateByCondition(['userId' => $userId], ['birthday' => $birthday]);
+                } 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;
+                $user->birthday = $birthday;
+                $user->save();
+                CustomClass::updateByCondition(['userId' => $userId], ['birthday' => $birthday]);
+            }
+        }
+
+
         $hasMap = dict::getDict('hasMap');
         $user['hasMap'] = $hasMap;
         util::success(['info' => $user]);

+ 43 - 0
biz-hd/custom/classes/CustomClass.php

@@ -14,8 +14,10 @@ use bizHd\order\classes\SettleClass;
 use bizHd\shop\classes\ShopClass;
 use common\components\dict;
 use common\components\imgUtil;
+use common\components\noticeUtil;
 use common\components\stringUtil;
 use common\components\util;
+use Overtrue\ChineseCalendar\Calendar;
 use Yii;
 use bizHd\base\classes\BaseClass;
 
@@ -671,6 +673,47 @@ class CustomClass extends BaseClass
                 'visitTime' => $visitTime,
                 'salt' => $salt,
             ];
+            $birthdaySet = $user->birthdaySet ?? 0;
+            if ($birthdaySet == 1) {
+                //如果用户自己设置过了生日,则生日给传过去
+                $lunar = $user->lunar ?? 0;
+                $birthday = $user->birthday ?? '';
+                $birthdayTime = $user->birthdayTime ?? 0;
+                $birthdayMonth = $user->birthdayMonth ?? 0;
+                $birthdayDate = $user->birthdayDate ?? 0;
+                //如果当年的生日时间没有更新,则需要给更新
+                $year = date("Y", strtotime($birthday));
+                $thisYear = date("Y");
+                if ($year != $thisYear) {
+                    if ($lunar == 1) {
+                        try {
+                            //农历转阳历,有多处使用,需要同步修改,关键词change_my_birthday
+                            $calendar = new Calendar();
+                            $result = $calendar->lunar(date("Y"), $birthdayMonth, $birthdayDate);
+                            $month = $result['gregorian_month'] ?? 1;
+                            $date = $result['gregorian_day'] ?? 1;
+                            $birthday = date("Y") . '-' . $month . '-' . $date;
+                            $user->birthday = $birthday;
+                            $user->save();
+                            CustomClass::updateByCondition(['userId' => $userId], ['birthday' => $birthday]);
+                        } 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;
+                        $user->birthday = $birthday;
+                        $user->save();
+                        CustomClass::updateByCondition(['userId' => $userId], ['birthday' => $birthday]);
+                    }
+                }
+                $data['birthday'] = $birthday;
+                $data['birthdayTime'] = $birthdayTime;
+                $data['birthdayMonth'] = $birthdayMonth;
+                $data['birthdayDate'] = $birthdayDate;
+                $data['lunar'] = $lunar;
+            }
             $custom = self::addCustom($data);
             $isNewCustom = 1;
         }

+ 2 - 2
common/components/book.php

@@ -91,9 +91,9 @@ class book
         'chargeStandard' => [
             ['style' => 'info', 'value' => '软件年费1580元,年费需每年付一次,客户通过小程序下单,会扣千分之3.3手续费(即1千元扣3.3元)。',],
             ['style' => 'info', 'value' => '根据你自身门店情况,选择以下套餐。下面列出的套餐,已经过全国100多家鲜花批发店磨合使用,非常成熟好用,请放心购买使用,以下套餐已含第一年年费。',],
-            ['style' => 'miniTitle', 'value' => '软件的研发成本巨大,不管是年费、费率和套餐,都已经最低价,没有谈的空间,不需要再找我们浪费时间,请理解。付费后不支持退货。',],
+            ['style' => 'miniTitle', 'value' => '软件的研发成本巨大,不管是年费、费率和套餐,都已经底价,没有商量的空间,请理解。付费后不支持退货。',],
             ['style' => 'info', 'value' => '首次开通系统,另外赠送30天有效期,保证有足够时间试运营。',],
-            ['style' => 'info', 'value' => '提供上门培训服务,培训时间3天,需报销差旅住宿费用,公司在福建厦门。',],
+            ['style' => 'info', 'value' => '提供上门培训服务,培训时间3天,需报销差旅住宿费用,公司地址在福建厦门。',],
             ['style' => 'smallTitle', 'value' => '仓库版',],
             ['style' => 'info', 'value' => '整套软件功能(一年)',],
             ['style' => 'info', 'value' => '小票机1台',],

+ 0 - 1
common/components/bookJd.php

@@ -8,7 +8,6 @@ class bookJd
     public static $list = [
         ['class' => '开始', 'icon' => '/book/begin.png', 'list' => [
             ['title' => '收费标准', 'id' => 'chargeStandard2'],
-            ['title' => '销花宝是什么', 'id' => 'what'],
             ['title' => '注册和下载APP', 'id' => 'register'],
             ['title' => '添加修改花材和分类(必看)', 'id' => 'flowerManage'],
             ['title' => '批量修改库存', 'id' => 'batchModifyStock'],