|
|
@@ -510,6 +510,55 @@ class WxMessageClass extends BaseClass
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ //预订增加减少通知 ssh 20240820
|
|
|
+ public static function bookChangeInform($shop, $arr)
|
|
|
+ {
|
|
|
+ $orderId = $arr['orderId']??0;
|
|
|
+ $ptStyle = $shop->ptStyle;
|
|
|
+ $wxBase = WxOpenClass::getWxBase();
|
|
|
+ $wx = $wxBase[$ptStyle] ?? [];
|
|
|
+ $message = self::getAllByCondition(['ptStyle' => $ptStyle], null, '*', 'shortTemplateId');
|
|
|
+ $shortTempId = 'OPENTM417875155';
|
|
|
+ $tempId = isset($message[$shortTempId]['templateId']) ? $message[$shortTempId]['templateId'] : '';
|
|
|
+ if (empty($tempId)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ $itemName = $arr['itemName']??'';
|
|
|
+ $io = $arr['io']??0;
|
|
|
+ $plus = $io == 1 ? '+' : '-';
|
|
|
+ $num = $arr['num']??0;
|
|
|
+ $title = $itemName.' '.$plus.$num;
|
|
|
+ $customName = $arr['customName'] ?? '';
|
|
|
+ $customName = stringUtil::subStringUtf8($customName, 5, '...');
|
|
|
+
|
|
|
+ $adminList = ShopAdminClass::getRemainAdmin($shop);
|
|
|
+ if (empty($adminList)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ foreach ($adminList as $admin) {
|
|
|
+ $openId = isset($admin['openId']) ? $admin['openId'] : '';
|
|
|
+ if ($ptStyle == dict::getDict('ptStyle', 'ghs')) {
|
|
|
+ $openId = isset($admin['ghsOpenId']) ? $admin['ghsOpenId'] : '';
|
|
|
+ }
|
|
|
+ $data = [
|
|
|
+ "touser" => $openId,
|
|
|
+ "template_id" => $tempId,
|
|
|
+ "url" => Yii::$app->params['ghsDomain'],
|
|
|
+ "data" => [
|
|
|
+ "first" => ["value" => '', "color" => "#173177"],
|
|
|
+ "keyword1" => ["value" => $title, "color" => "#173177"],
|
|
|
+ "keyword2" => ["value" => $customName, "color" => "#173177"],
|
|
|
+ "keyword3" => ["value" => date("Y-m-d H:i"), "color" => "#173177"],
|
|
|
+ "remark" => ["value" => "点击查看详情", "color" => "#173177"]
|
|
|
+ ]
|
|
|
+ ];
|
|
|
+ $data['miniprogram']['appid'] = $wx['miniAppId'];
|
|
|
+ $data['miniprogram']['pagepath'] = 'pagesOrder/detail?id=' . $orderId;
|
|
|
+ wxUtil::sendTaskInform($data, $wx, $ptStyle);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
//花店新采购单通知 ssh 20231128
|
|
|
public static function hdNewCgOrderInform($shop, $cg)
|
|
|
{
|