Pārlūkot izejas kodu

新收入提醒

shish 5 gadi atpakaļ
vecāks
revīzija
43cb3bc882

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

@@ -285,6 +285,8 @@ class OrderClass extends BaseClass
                         OrderSendClass::withoutSend($order);
                         OrderSendClass::withoutSend($order);
                     }
                     }
                 }
                 }
+                //您有新的收入提醒(门店订单)
+                WxMessageClass::gatheringIncomeInform($shop, $order);
             }
             }
         };
         };
         //来自商城的订单通知 linqh 2021.5.19
         //来自商城的订单通知 linqh 2021.5.19

+ 41 - 0
biz/wx/classes/WxMessageClass.php

@@ -317,6 +317,47 @@ class WxMessageClass extends BaseClass
         }
         }
     }
     }
 
 
+    //收款码收入通知 shish 20210531
+    public static function gatheringIncomeInform($shop, $order)
+    {
+        $shopId = $shop->id;
+        $ptStyle = $shop->ptStyle;
+        $wxBase = WxOpenClass::getWxBase();
+        $wx = $wxBase[$ptStyle] ?? [];
+        $message = self::getAllByCondition(['ptStyle' => $ptStyle], null, '*', 'shortTemplateId');
+        $shortTempId = 'OPENTM207422813';//收入提醒
+        $tempId = isset($message[$shortTempId]['templateId']) ? $message[$shortTempId]['templateId'] : '';
+        if (empty($tempId)) {
+            return false;
+        }
+        $actPrice = $order->actPrice;
+        $orderId = $order->id;
+        $adminList = ShopAdminClass::getRemainAdmin($shopId);
+        foreach ($adminList as $admin) {
+            if (isset($admin['subscribe']) == false || $admin['subscribe'] == 0) {
+                continue;
+            }
+            $openId = isset($admin['openId']) ? $admin['openId'] : '';
+            $data = [
+                "touser" => $openId,
+                "template_id" => $tempId,
+                "url" => Yii::$app->params['ghsDomain'],
+                "data" => [
+                    "first" => ["value" => "您有新的收入。", "color" => "#173177"],
+                    "keyword1" => ["value" => $actPrice, "color" => "#173177"],
+                    "keyword2" => ["value" => '扫码付款', "color" => "#173177"],
+                    "keyword3" => ["value" => date("Y-m-d H:i"), "color" => "#173177"],
+                    "remark" => ["value" => "点击查看详情", "color" => "#173177"]
+                ]
+            ];
+            $data['miniprogram']['appid'] = $wx['miniAppId'];
+            $data['miniprogram']['pagepath'] = 'admin/order/detail?id=' . $orderId;
+
+            wxUtil::sendTaskInform($data, $wx, $ptStyle);
+        }
+    }
+
+
     //提现成功通知 shish 20210531
     //提现成功通知 shish 20210531
     public static function cashInform($shop, $cash)
     public static function cashInform($shop, $cash)
     {
     {