shish 3 жил өмнө
parent
commit
41fa45ba4d

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

@@ -121,6 +121,16 @@ class WxMessageClass extends BaseClass
     //供货商有新的退款申请 ssh 20230815
     //供货商有新的退款申请 ssh 20230815
     public static function ghsHasNewRefundApplyInform($shop, $refund)
     public static function ghsHasNewRefundApplyInform($shop, $refund)
     {
     {
+        $id = $refund->id;
+        $refundSn = $refund->orderSn ?? '';
+        $refundType = $refund->refundType ?? 1;
+        $refundName = $refundType == 1 ? '退货退款' : '只退款';
+        $addTime = $refund->addTime ?? '';
+        $refundPrice = $refund->refundPrice ?? '';
+        $refundPrice = floatval($refundPrice);
+        $customId = $refund->customId ?? 0;
+        $custom = CustomClass::getById($customId, true);
+        $customName = $custom->name ?? '--';
         $ptStyle = $shop->ptStyle;
         $ptStyle = $shop->ptStyle;
         $wxBase = WxOpenClass::getWxBase();
         $wxBase = WxOpenClass::getWxBase();
         $wx = $wxBase[$ptStyle] ?? [];
         $wx = $wxBase[$ptStyle] ?? [];
@@ -144,15 +154,15 @@ class WxMessageClass extends BaseClass
                 "template_id" => $tempId,
                 "template_id" => $tempId,
                 "url" => Yii::$app->params['ghsDomain'],
                 "url" => Yii::$app->params['ghsDomain'],
                 "data" => [
                 "data" => [
-                    "amount1" => ["value" => '10元'],
-                    "thing7" => ["value" => '张三'],
-                    "time10" => ["value" => '2022-02-30 11:21:30'],
-                    "thing2" => ["value" => '退货退款'],
-                    "character_string3" => ["value" => '2023060900000001'],
+                    "amount1" => ["value" => $refundPrice . '元'],
+                    "thing7" => ["value" => $customName],
+                    "time10" => ["value" => $addTime],
+                    "thing2" => ["value" => $refundName],
+                    "character_string3" => ["value" => $refundSn],
                 ]
                 ]
             ];
             ];
             $data['miniprogram']['appid'] = $wx['miniAppId'];
             $data['miniprogram']['appid'] = $wx['miniAppId'];
-            $data['miniprogram']['pagepath'] = 'pagesOrder/detail?id=1';
+            $data['miniprogram']['pagepath'] = 'pagesOrder/refundDetail?from=1&id=' . $id;
             wxUtil::sendTaskInform($data, $wx, $ptStyle);
             wxUtil::sendTaskInform($data, $wx, $ptStyle);
         }
         }
     }
     }