فهرست منبع

Merge branch 'master' into dev

shish 1 ماه پیش
والد
کامیت
030074a70d

+ 3 - 2
app-ghs/controllers/ConsoleController.php

@@ -127,6 +127,7 @@ class ConsoleController extends BaseController
      */
     public function actionGetYesterdayIncome()
     {
+        util::success(['income' => 0]);
         if (empty($this->mainId)) {
             util::success(['income' => 0]);
             return;
@@ -177,7 +178,7 @@ class ConsoleController extends BaseController
         //$notice[] = ['title' => '客户多个订单开始支持一键分享', 'action' => '查看', 'page' => '/admin/book/detail?id=calc'];
         //$notice[] = ['title' => '如果你发现一个问题很重要,一直没给你处理,在小群多反应几次,用反应次数强调重要性,目前批发店多反应问题多,都在排队。', 'action' => '', 'page' => ''];
         //$notice[] = ['title' => '新功能:客户端和后台使用跑腿的流程', 'action' => '', 'page' => '/admin/book/detail?id=use_pt'];
-        //$notice[] = ['title' => '分享订单打不开的解决办法', 'action' => '查看', 'page' => '/admin/book/detail?id=calc'];
+        $notice[] = ['title' => '明天凌晨2:30到3:00,升级服务器,暂停使用', 'action' => '', 'page' => ''];
         //$notice[] = ['title' => '急事请连续打二次电话 15280215347', 'action' => '', 'page' => ''];
 
         $mainId = $this->mainId;
@@ -317,7 +318,7 @@ class ConsoleController extends BaseController
 
         $warning = '';
         $warningUrl = '';
-        //$warning = '挂账和结账重大调整(已上线) 查看 >';
+        $warning = '本页右上方,暂不显示昨天收入金额';
         //$warningUrl = '/admin/notice/warning';
 
         util::success([

+ 11 - 3
app-hd/controllers/AuthController.php

@@ -643,7 +643,13 @@ class AuthController extends PublicController
         util::success(['token' => $token, 'account' => $sjId, 'shopId' => $currentShopId, 'imgUploadApi' => $imgUploadApi, 'switchShop' => $switchShop,]);
     }
 
-    //静默获取小程序用户信息
+    /**
+     * 静默获取小程序用户信息
+     * 职责:通过微信小程序 code 换取 openid 和 session_key 并自动登录
+     * 入参:GET 传参 code (微信临时登录凭证)
+     * 返回:登录成功返回 token、用户信息、店铺 ID 等;失败返回空 token
+     * 副作用:会更新管理员的最后登录时间,并将 session_key 写入 Redis 缓存
+     */
     public function actionMiniInfo()
     {
         //花店平台
@@ -660,6 +666,10 @@ class AuthController extends PublicController
         $url = "https://api.weixin.qq.com/sns/jscode2session?appid={$appId}&secret={$appSecret}&js_code={$code}&grant_type=authorization_code";
         $curl = new curl\Curl();
         $curl->setOption(CURLOPT_SSL_VERIFYPEER, false);
+        // 复杂分支/关键逻辑:设置 cURL 连接和执行超时,并强制使用 IPv4,防止因微信接口卡顿或 DNS 解析慢拖垮 PHP-FPM 进程
+        $curl->setOption(CURLOPT_CONNECTTIMEOUT, 2); // 连接超时限制为 2 秒,避免网络握手长时间卡死
+        $curl->setOption(CURLOPT_TIMEOUT, 3);        // 总执行时间限制为 3 秒,避免请求挂起时间过长
+        $curl->setOption(CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4); // 强制 IPv4 解析,防止 IPv6 解析超时重试
         $result = $curl->get($url);
         $arr = Json::decode($result);
         $sessionKey = isset($arr['session_key']) ? $arr['session_key'] : '';
@@ -720,8 +730,6 @@ class AuthController extends PublicController
             //账号冻结不再自动登录
             util::success(['token' => '', 'currentMiniOpenId' => $openid, 'sn' => 6]);
         }
-        $shopAdmin->lastLogin = date("Y-m-d H:i:s");
-        $shopAdmin->save();
         $shopAdminId = $shopAdmin->id ?? 0;
 
         //是否有切换门店的权限

+ 1 - 1
app-hd/controllers/CustomController.php

@@ -433,7 +433,7 @@ class CustomController extends BaseController
                 "keyword2" => ["value" => $date, "color" => "#173177"],
                 "remark" => ["value" => "点击查看会员权益", "color" => "#173177"],
             ]];
-        wxUtil::sendTaskInform($data, $this->sj);
+        //wxUtil::sendTaskInform($data, $this->sj);
         util::complete();
     }
 

+ 3 - 0
app-hd/controllers/CustomRechargeController.php

@@ -24,6 +24,9 @@ class CustomRechargeController extends BaseController
     //充值 ssh 20240507
     public function actionRecharge()
     {
+
+        //util::fail('请下午3点后再试');
+
         ini_set('date.timezone', 'Asia/Shanghai');
         $post = Yii::$app->request->post();
         $payWay = $post['payWay'] ?? 0;

+ 1 - 1
app-hd/controllers/NoticeController.php

@@ -479,7 +479,7 @@ class NoticeController extends PublicController
 //                            $noticeKey = "hdCgNoticeGhs";
 //                            Yii::$app->redis->executeCommand('LPUSH', [$noticeKey, $noticeText]);
 
-                            GhsNotifyClass::newOrderNotify($saleId);
+                            //GhsNotifyClass::newOrderNotify($saleId);
 
                             //向供货商APP发通知
 //                            $cgShop = ShopClass::getById($cg->shopId, true, 'shopName, merchantName');

+ 3 - 0
app-hd/controllers/PurchaseClearController.php

@@ -23,6 +23,9 @@ class PurchaseClearController extends BaseController
     //生成结帐订单 ssh 2021.1.26
     public function actionCreateOrder()
     {
+
+        //util::fail('请下午3点后再试');
+
         $transaction = Yii::$app->db->beginTransaction();
         try {
             $post = Yii::$app->request->post();

+ 2 - 1
app-hd/controllers/WorkController.php

@@ -77,6 +77,7 @@ class WorkController extends BaseController
     //制作单列表 ssh 20220319
     public function actionList()
     {
+        util::fail('请更新应用');
         $get = Yii::$app->request->get();
         $where = [];
         $where['mainId'] = $this->mainId;
@@ -301,4 +302,4 @@ class WorkController extends BaseController
         }
     }
 
-}
+}

+ 2 - 2
app-pt/views/main/app.php

@@ -237,8 +237,8 @@
             const downloadUrls = {
                 'xiaohuabao': 'https://api.shop.hzghd.com/1312.apk', // 销花宝APP下载链接
                 'huazhanggui': 'https://api.shop.hzghd.com/246.apk', // 花掌柜APP下载链接
-                'huazhanggui_cashier': 'https://api.shop.hzghd.com/200.apk', // 花掌柜收银下载链接
-                'xiaohuabao_cashier': 'https://api.shop.hzghd.com/159.apk' // 销花宝收银下载链接
+                'huazhanggui_cashier': 'https://api.shop.hzghd.com/209.apk', // 花掌柜收银下载链接
+                'xiaohuabao_cashier': 'https://api.shop.hzghd.com/168.apk' // 销花宝收银下载链接
             };
             const url = downloadUrls[appType];
             if (url && url !== '#') {

+ 17 - 17
biz-hd/notice/classes/NoticeClass.php

@@ -57,10 +57,10 @@ class NoticeClass extends BaseClass
                             ];
                             $page = 'pagesPurchase/refundDetail?id=' . $refund->id;
                             Yii::info(json_encode($msg));
-                            $respond = miniUtil::commonSendSubscribeMessage($merchant, $ptStyle, $msgId, $miniOpenId, $page, $msg);
-                            if (isset($respond['errcode']) && $respond['errcode'] === 0) {
-                                $result['hasNotice'] = 1;
-                            }
+//                            $respond = miniUtil::commonSendSubscribeMessage($merchant, $ptStyle, $msgId, $miniOpenId, $page, $msg);
+//                            if (isset($respond['errcode']) && $respond['errcode'] === 0) {
+//                                $result['hasNotice'] = 1;
+//                            }
                         }
                     }
                 }
@@ -105,10 +105,10 @@ class NoticeClass extends BaseClass
                             ];
                             $page = 'admin/clear/info?id=' . $clear->id;
                             Yii::info(json_encode($msg));
-                            $respond = miniUtil::commonSendSubscribeMessage($merchant, $ptStyle, $msgId, $miniOpenId, $page, $msg);
-                            if (isset($respond['errcode']) && $respond['errcode'] === 0) {
-                                $result['hasNotice'] = 1;
-                            }
+//                            $respond = miniUtil::commonSendSubscribeMessage($merchant, $ptStyle, $msgId, $miniOpenId, $page, $msg);
+//                            if (isset($respond['errcode']) && $respond['errcode'] === 0) {
+//                                $result['hasNotice'] = 1;
+//                            }
                         }
                     }
                 }
@@ -168,10 +168,10 @@ class NoticeClass extends BaseClass
                                 "thing5" => ["value" => $remark]
                             ];
                             $page = 'pagesPurchase/purDetails?id=' . $cg->id;
-                            $respond = miniUtil::commonSendSubscribeMessage($merchant, $ptStyle, $msgId, $miniOpenId, $page, $msg);
-                            if (isset($respond['errcode']) && $respond['errcode'] === 0) {
-                                $result['hasNotice'] = 1;
-                            }
+//                            $respond = miniUtil::commonSendSubscribeMessage($merchant, $ptStyle, $msgId, $miniOpenId, $page, $msg);
+//                            if (isset($respond['errcode']) && $respond['errcode'] === 0) {
+//                                $result['hasNotice'] = 1;
+//                            }
                         }
                     }
                 }
@@ -235,10 +235,10 @@ class NoticeClass extends BaseClass
                                 "thing6" => ["value" => $remark]
                             ];
                             $page = 'pagesPurchase/purDetails?id=' . $cg->id;
-                            $respond = miniUtil::commonSendSubscribeMessage($merchant, $ptStyle, $msgId, $miniOpenId, $page, $msg);
-                            if (isset($respond['errcode']) && $respond['errcode'] === 0) {
-                                $result['hasNotice'] = 1;
-                            }
+//                            $respond = miniUtil::commonSendSubscribeMessage($merchant, $ptStyle, $msgId, $miniOpenId, $page, $msg);
+//                            if (isset($respond['errcode']) && $respond['errcode'] === 0) {
+//                                $result['hasNotice'] = 1;
+//                            }
                         }
                     }
                 }
@@ -247,4 +247,4 @@ class NoticeClass extends BaseClass
         return $result;
     }
 
-}
+}

+ 3 - 2
biz-hd/order/classes/OrderClass.php

@@ -462,8 +462,9 @@ class OrderClass extends BaseClass
             }
         }
         if ($order->payStatus == 1) {
-            noticeUtil::push('注意,零售订单:' . $orderSn . ',已经付过款了,无需重复请求和操作', '15280215347');
-            util::fail('订单已经付过款了');
+            noticeUtil::push('注意,零售订单:' . $orderSn . ',已经付过款了。已经重新返回 success', '15280215347');
+            echo "SUCCESS";
+            exit();
         }
 
         $orderId = $order->id ?? 0;

+ 5 - 0
biz-hd/purchase/classes/PurchaseClearClass.php

@@ -165,6 +165,11 @@ class PurchaseClearClass extends BaseClass
             $ghsName = $order->ghsName ?? '';
             $customName = $order->customName ?? '';
             $orderSn = $order->orderSn ?? '';
+            if($order->status == self::STATUS_HAS_PAY){
+                echo "SUCCESS";
+                noticeUtil::push("花店线上付款结账,但结账单不是待付款状态。已经返回 success 。供货商:{$ghsName},客户:{$customName},订单编号:{$orderSn}", '15280215347');
+                exit();
+            }
             noticeUtil::push("花店线上付款结账,但结账单不是待付款状态。供货商:{$ghsName},客户:{$customName},订单编号:{$orderSn}", '15280215347');
             util::fail('订单不是待付款状态');
         }

+ 6 - 1
biz/wx/classes/WxMessageClass.php

@@ -230,6 +230,7 @@ class WxMessageClass extends BaseClass
     //供货商有新的退款申请 ssh 20230815
     public static function ghsHasNewRefundApplyInform($shop, $refund)
     {
+        return false;
         $id = $refund->id;
         $refundSn = $refund->orderSn ?? '';
         $refundType = $refund->refundType ?? 1;
@@ -392,6 +393,7 @@ class WxMessageClass extends BaseClass
     //客户结清账单提醒 ssh 20240512
     public static function customHasClearToGhsInform($shop, $clearInfo, $custom)
     {
+        return false;
         //账单编号 合同金额 客户名称
         $ptStyle = $shop->ptStyle;
         $id = $clearInfo->id ?? 0;
@@ -439,6 +441,7 @@ class WxMessageClass extends BaseClass
     //客户充值清账通知 ssh 20240511
     public static function customRechargeClearInform($shop, $recharge)
     {
+        return false;
         //充值金额 商品名称 姓名 操作人 充值时间
         $ptStyle = $shop->ptStyle;
         $amount = $recharge->amount ?? 0;
@@ -1001,6 +1004,7 @@ class WxMessageClass extends BaseClass
     //收款码收入通知 ssh 20210531
     public static function gatheringIncomeInform($shop, $order)
     {
+        return false;
         if ($order->payStatus != 1) {
             return false;
         }
@@ -1383,6 +1387,7 @@ class WxMessageClass extends BaseClass
     //供货商新客户通知 ssh 20210909
     public static function newGhsCustomInform($shop, $custom, $introduce = [])
     {
+        return false;
         $ptStyle = $shop->ptStyle ?? 0;
         $wxBase = WxOpenClass::getWxBase();
         $wx = $wxBase[$ptStyle] ?? [];
@@ -1577,4 +1582,4 @@ class WxMessageClass extends BaseClass
         }
     }
 
-}
+}