shish 4 年 前
コミット
9baca6893c

+ 5 - 4
common/components/noticeUtil.php

@@ -26,7 +26,6 @@ class noticeUtil
             $mobile_list = is_array($mobile_list) == false ? [(string)$mobile_list] : $mobile_list;
             $data['at']['atMobiles'] = $mobile_list;
         }
-
         $data_string = json_encode($data);
         self::request($url, $data_string);
     }
@@ -40,9 +39,11 @@ class noticeUtil
         curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json;charset=utf-8'));
         curl_setopt($ch, CURLOPT_POSTFIELDS, $post_string);
         curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
-        // 线下环境不用开启curl证书验证, 未调通情况可尝试添加该代码
-        // curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, 0);
-        // curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, 0);
+        if (getenv('YII_ENV') == 'local') {
+            // 线下环境不用开启curl证书验证, 未调通情况可尝试添加该代码
+            curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
+            curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
+        }
         $data = curl_exec($ch);
         curl_close($ch);
         return $data;

+ 1 - 8
console/controllers/CustomController.php

@@ -136,7 +136,6 @@ class CustomController extends Controller
             $customList[] = $customer;
         }
         $customList = ['石石石_17061583291_12887_36413_好运鲜花批发_126129'];
-
         if (empty($customList)) {
             return false;
         }
@@ -156,48 +155,42 @@ class CustomController extends Controller
                 $post['introSjId'] = $customerInfo[2];
                 $post['introShopId'] = $customerInfo[3];
                 $post['introSjName'] = $customerInfo[4];
-echo '1';
+
                 $post['name'] = $shopName;
                 if (empty($shopName)) {
                     noticeUtil::push("花店 {$shopName} 手机号 {$mobile} 添加失败,原因:名称没有填写", '15280215347');
                     $transaction->rollBack();
                     continue;
                 }
-                echo '12';
                 $post['mobile'] = $mobile;
                 if (stringUtil::isMobile($mobile) == false) {
                     noticeUtil::push("花店 {$shopName} 手机号 {$mobile} 添加失败,原因:手机号填写错误", '15280215347');
                     $transaction->rollBack();
                     continue;
                 }
-                echo '13';
                 if (stringUtil::getWordNum($shopName) > 8) {
                     noticeUtil::push("花店 {$shopName} 手机号 {$mobile} 添加失败,原因:名称超过了8个汉字", '15280215347');
                     $transaction->rollBack();
                     continue;
                 }
-                echo '14';
                 $has = SjClass::getByCondition(['name' => $shopName]);
                 if (!empty($has)) {
                     noticeUtil::push("花店 {$shopName} 手机号 {$mobile} 添加失败,原因:名称已经存在了哦", '15280215347');
                     $transaction->rollBack();
                     continue;
                 }
-                echo '15';
                 $has = ApplyClass::getByCondition(['mobile' => $mobile]);
                 if (!empty($has)) {
                     noticeUtil::push("花店 {$shopName} 手机号 {$mobile} 添加失败,原因:手机号已经存在了哦", '15280215347');
                     $transaction->rollBack();
                     continue;
                 }
-                echo '16';
                 $hasShop = ShopClass::getByCondition(['mobile' => $mobile]);
                 if (!empty($hasShop)) {
                     noticeUtil::push("花店 {$shopName} 手机号 {$mobile} 添加失败,原因:手机号已经存在了", '15280215347');
                     $transaction->rollBack();
                     continue;
                 }
-                echo '17';
                 $adminName = $post['adminName'] ?? '';
                 $miniOpenId = $post['miniOpenId'] ?? '';
                 $adminInfo = ['name' => $adminName, 'mobile' => $mobile, 'miniOpenId' => $miniOpenId];