WxMessageClass.php 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525
  1. <?php
  2. namespace biz\wx\classes;
  3. use biz\base\classes\BaseClass;
  4. use biz\shop\classes\ShopAdminClass;
  5. use common\components\dict;
  6. use common\components\noticeUtil;
  7. use common\components\util;
  8. use common\components\wxUtil;
  9. use Yii;
  10. class WxMessageClass extends BaseClass
  11. {
  12. public static $baseFile = '\biz\wx\models\WxMessage';
  13. public static function has()
  14. {
  15. return [
  16. //零售
  17. dict::getDict('ptStyle', 'hd') => [
  18. 'OPENTM417875155' => '新订单通知',
  19. 'OPENTM207430125' => '操作成功通知',
  20. 'OPENTM401915538' => '审核通知',
  21. 'OPENTM201205968' => '订单送达通知',
  22. 'OPENTM207777535' => '付款提醒',
  23. 'OPENTM207422813' => '收入提醒',
  24. 'OPENTM202297555' => '下单成功通知',
  25. 'OPENTM207327227' => '宝贝售出提醒',
  26. 'OPENTM207188526' => '付款成功',
  27. 'OPENTM411207151' => '提现成功通知',
  28. 'OPENTM416881153' => '发货通知',
  29. 'OPENTM407280253' => '退款成功通知',
  30. ],
  31. //供应商
  32. dict::getDict('ptStyle', 'ghs') => [
  33. 'OPENTM417875155' => '新订单通知',
  34. 'OPENTM207430125' => '操作成功通知',
  35. 'OPENTM401915538' => '审核通知',
  36. 'OPENTM201205968' => '订单送达通知',
  37. 'OPENTM207777535' => '付款提醒',
  38. 'OPENTM207422813' => '收入提醒',
  39. 'OPENTM202297555' => '下单成功通知',
  40. 'OPENTM207327227' => '宝贝售出提醒',
  41. 'OPENTM207188526' => '付款成功',
  42. 'OPENTM411207151' => '提现成功通知',
  43. 'OPENTM416881153' => '发货通知',
  44. 'OPENTM407280253' => '退款成功通知',
  45. ],
  46. //商城
  47. dict::getDict('ptStyle', 'mall') => [
  48. ],
  49. ];
  50. }
  51. //初始化消息模板
  52. // ./yii.bat wx-message/init
  53. public static function init()
  54. {
  55. $wxBase = [
  56. dict::getDict('ptStyle', 'hd') => \bizHd\wx\classes\WxOpenClass::getWxInfo(),
  57. dict::getDict('ptStyle', 'ghs') => \bizHd\wx\classes\WxOpenClass::getGhsWxInfo(),
  58. dict::getDict('ptStyle', 'mall') => \bizHd\wx\classes\WxOpenClass::getMallWxInfo(),
  59. ];
  60. $message = self::getAllByCondition([], null, '*', null, true);
  61. if (!empty($message)) {
  62. foreach ($message as $item) {
  63. $ptStyle = $item->ptStyle;
  64. $wx = $wxBase[$ptStyle] ?? [];
  65. if (empty($wx)) {
  66. util::fail('没有找到微信平台信息');
  67. }
  68. $templateId = $item->templateId;
  69. $respond = wxUtil::delTMessage($wx, $templateId, $ptStyle);
  70. if (isset($respond['errcode']) && $respond['errcode'] == 0) {
  71. $item->delete();
  72. }
  73. }
  74. }
  75. $wxMessageList = self::has();
  76. foreach ($wxMessageList as $k => $message) {
  77. $ptStyle = $k;
  78. if (empty($message)) {
  79. continue;
  80. }
  81. $wx = $wxBase[$ptStyle] ?? [];
  82. foreach ($message as $shortId => $title) {
  83. $wxReturn = wxUtil::tMessageCreate($wx, $shortId, $ptStyle);
  84. echo json_encode($wxReturn) . "\n";
  85. if (isset($wxReturn['errcode']) && $wxReturn['errcode'] == 0) {
  86. $templateId = $wxReturn['template_id'];
  87. $data = [
  88. 'shortTemplateId' => $shortId,
  89. 'templateId' => $templateId,
  90. 'templateName' => $title,
  91. 'ptStyle' => $ptStyle,
  92. ];
  93. self::add($data);
  94. //Yii::warning("add tmessage:" . $title . " success\n");
  95. } else {
  96. Yii::warning("add tmessage error:" . json_encode($wxReturn) . " \n");
  97. noticeUtil::push("add wx message {$shortId} error:" . json_encode($wxReturn), '15280215347');
  98. }
  99. }
  100. }
  101. }
  102. //供应商新订单通知 shish 20210529
  103. public static function newOrderInform($shop, $order)
  104. {
  105. $shopId = $shop->id;
  106. $ptStyle = $shop->ptStyle;
  107. $wxBase = WxOpenClass::getWxBase();
  108. $wx = $wxBase[$ptStyle] ?? [];
  109. $message = self::getAllByCondition(['ptStyle' => $ptStyle], null, '*', 'shortTemplateId');
  110. $shortTempId = 'OPENTM417875155';//新订单通知
  111. $tempId = isset($message[$shortTempId]['templateId']) ? $message[$shortTempId]['templateId'] : '';
  112. if (empty($tempId)) {
  113. return false;
  114. }
  115. $orderId = $order->id;
  116. $actPrice = $order->actPrice;
  117. $adminList = ShopAdminClass::getRemainAdmin($shopId);
  118. foreach ($adminList as $admin) {
  119. if (isset($admin['subscribe']) == false || $admin['subscribe'] == 0) {
  120. continue;
  121. }
  122. $openId = isset($admin['openId']) ? $admin['openId'] : '';
  123. $data = [
  124. "touser" => $openId,
  125. "template_id" => $tempId,
  126. "url" => Yii::$app->params['ghsDomain'],
  127. "data" => [
  128. "first" => ["value" => "您有新的订单,请注意查收", "color" => "#173177"],
  129. "keyword1" => ["value" => $order->orderSn, "color" => "#173177"],
  130. "keyword2" => ["value" => $actPrice, "color" => "#173177"],
  131. "keyword3" => ["value" => date("Y-m-d H:i"), "color" => "#173177"],
  132. "remark" => ["value" => "点击查看详情", "color" => "#173177"]
  133. ]
  134. ];
  135. $data['miniprogram']['appid'] = $wx['miniAppId'];
  136. $data['miniprogram']['pagepath'] = 'pagesOrder/detail?id=' . $orderId;
  137. wxUtil::sendTaskInform($data, $wx, $ptStyle);
  138. }
  139. }
  140. //花店新订单通知 shish 20210529
  141. public static function hdNewOrderInform($shop, $order)
  142. {
  143. $shopId = $shop->id;
  144. $ptStyle = $shop->ptStyle;
  145. $wxBase = WxOpenClass::getWxBase();
  146. $wx = $wxBase[$ptStyle] ?? [];
  147. $message = self::getAllByCondition(['ptStyle' => $ptStyle], null, '*', 'shortTemplateId');
  148. $shortTempId = 'OPENTM417875155';//新订单通知
  149. $tempId = isset($message[$shortTempId]['templateId']) ? $message[$shortTempId]['templateId'] : '';
  150. if (empty($tempId)) {
  151. return false;
  152. }
  153. $orderId = $order->id;
  154. $actPrice = $order->actPrice;
  155. $adminList = ShopAdminClass::getRemainAdmin($shopId);
  156. foreach ($adminList as $admin) {
  157. if (isset($admin['subscribe']) == false || $admin['subscribe'] == 0) {
  158. continue;
  159. }
  160. $openId = isset($admin['openId']) ? $admin['openId'] : '';
  161. $data = [
  162. "touser" => $openId,
  163. "template_id" => $tempId,
  164. "url" => Yii::$app->params['ghsDomain'],
  165. "data" => [
  166. "first" => ["value" => "您有新的订单,请注意查收", "color" => "#173177"],
  167. "keyword1" => ["value" => $order->orderSn, "color" => "#173177"],
  168. "keyword2" => ["value" => $actPrice, "color" => "#173177"],
  169. "keyword3" => ["value" => date("Y-m-d H:i"), "color" => "#173177"],
  170. "remark" => ["value" => "点击查看详情", "color" => "#173177"]
  171. ]
  172. ];
  173. $data['miniprogram']['appid'] = $wx['miniAppId'];
  174. $data['miniprogram']['pagepath'] = 'admin/order/detail?id=' . $orderId;
  175. wxUtil::sendTaskInform($data, $wx, $ptStyle);
  176. }
  177. }
  178. //审核通过通知 shish 20210530
  179. public static function applyPass($shop)
  180. {
  181. $shopId = $shop->id;
  182. $ptStyle = $shop->ptStyle;
  183. $wxBase = WxOpenClass::getWxBase();
  184. $wx = $wxBase[$ptStyle] ?? [];
  185. $message = self::getAllByCondition(['ptStyle' => $ptStyle], null, '*', 'shortTemplateId');
  186. $shortTempId = 'OPENTM401915538';//审核通过通知
  187. $tempId = isset($message[$shortTempId]['templateId']) ? $message[$shortTempId]['templateId'] : '';
  188. if (empty($tempId)) {
  189. return false;
  190. }
  191. $adminList = ShopAdminClass::getRemainAdmin($shopId);
  192. if (empty($adminList)) {
  193. return false;
  194. }
  195. foreach ($adminList as $admin) {
  196. if (isset($admin['subscribe']) == false || $admin['subscribe'] == 0) {
  197. continue;
  198. }
  199. $openId = isset($admin['openId']) ? $admin['openId'] : '';
  200. $data = array(
  201. "touser" => $openId,
  202. "template_id" => $tempId,
  203. "url" => Yii::$app->params['ghsDomain'],
  204. "data" => array(
  205. "first" => array(
  206. "value" => "恭喜,您的开店申请审核通过。",
  207. "color" => "#173177"
  208. ),
  209. "keyword1" => array(
  210. "value" => '审核通过',
  211. "color" => "#173177"
  212. ),
  213. "keyword2" => array(
  214. "value" => date("Y-m-d H:i:s"),
  215. "color" => "#173177"
  216. ),
  217. "remark" => array(
  218. "value" => '点击登陆后台',
  219. "color" => "#173177"
  220. )
  221. ),
  222. );
  223. $data['miniprogram']['appid'] = $wx['miniAppId'];
  224. $data['miniprogram']['pagepath'] = 'admin/home/workbench';
  225. wxUtil::sendTaskInform($data, $wx, $ptStyle);
  226. }
  227. }
  228. //采购单下单成功 shish 20210531
  229. public static function generateCgOrder($shop, $order)
  230. {
  231. $shopId = $shop->id;
  232. $ptStyle = $shop->ptStyle;
  233. $wxBase = WxOpenClass::getWxBase();
  234. $wx = $wxBase[$ptStyle] ?? [];
  235. $message = self::getAllByCondition(['ptStyle' => $ptStyle], null, '*', 'shortTemplateId');
  236. $shortTempId = 'OPENTM202297555';//下单成功通知
  237. $tempId = isset($message[$shortTempId]['templateId']) ? $message[$shortTempId]['templateId'] : '';
  238. if (empty($tempId)) {
  239. return false;
  240. }
  241. $orderId = $order->id;
  242. $orderSn = (string)$order->orderSn;
  243. $totalFee = $order->actPrice;
  244. $adminList = ShopAdminClass::getRemainAdmin($shopId);
  245. foreach ($adminList as $admin) {
  246. if (isset($admin['subscribe']) == false || $admin['subscribe'] == 0) {
  247. continue;
  248. }
  249. $openId = isset($admin['openId']) ? $admin['openId'] : '';
  250. $data = [
  251. "touser" => $openId,
  252. "template_id" => $tempId,
  253. "url" => Yii::$app->params['ghsDomain'],
  254. "data" => [
  255. "first" => ["value" => '亲,您的采购单已生成', "color" => "#173177"],
  256. "keyword1" => ["value" => $orderSn, "color" => "#173177"],
  257. "keyword2" => ["value" => '花材', "color" => "#173177"],
  258. "keyword3" => ["value" => $order->bigNum . '/' . $order->smallNum, "color" => "#173177"],
  259. "keyword4" => ["value" => number_format($totalFee, 2) . '元', "color" => "#173177"],
  260. "keyword5" => ["value" => '-', "color" => "#173177"],
  261. "remark" => ["value" => "", "color" => "#173177"]
  262. ]
  263. ];
  264. $data['miniprogram']['appid'] = $wx['miniAppId'];
  265. $data['miniprogram']['pagepath'] = 'pagesPurchase/purDetails?id=' . $orderId;
  266. wxUtil::sendTaskInform($data, $wx, $ptStyle);
  267. }
  268. }
  269. //采购单已发货 shish 20210531
  270. public static function cgOrderHasSend($shop, $order)
  271. {
  272. $shopId = $shop->id;
  273. $ptStyle = $shop->ptStyle;
  274. $wxBase = WxOpenClass::getWxBase();
  275. $wx = $wxBase[$ptStyle] ?? [];
  276. $message = self::getAllByCondition(['ptStyle' => $ptStyle], null, '*', 'shortTemplateId');
  277. $shortTempId = 'OPENTM416881153';//下单成功通知
  278. $tempId = isset($message[$shortTempId]['templateId']) ? $message[$shortTempId]['templateId'] : '';
  279. if (empty($tempId)) {
  280. return false;
  281. }
  282. $orderId = $order->id;
  283. $orderSn = (string)$order->orderSn;
  284. $adminList = ShopAdminClass::getRemainAdmin($shopId);
  285. $ghsShopAdminName = $order->ghsShopAdminName ?? '';
  286. foreach ($adminList as $admin) {
  287. if (isset($admin['subscribe']) == false || $admin['subscribe'] == 0) {
  288. continue;
  289. }
  290. $openId = isset($admin['openId']) ? $admin['openId'] : '';
  291. $data = [
  292. "touser" => $openId,
  293. "template_id" => $tempId,
  294. "url" => Yii::$app->params['ghsDomain'],
  295. "data" => [
  296. "first" => ["value" => '亲,您的采购单已发货,请注意签收', "color" => "#173177"],
  297. "keyword1" => ["value" => $orderSn, "color" => "#173177"],
  298. "keyword2" => ["value" => date("Y-m-d H:i:s"), "color" => "#173177"],
  299. "keyword3" => ["value" => $ghsShopAdminName, "color" => "#173177"],
  300. "remark" => ["value" => "点击查看详情", "color" => "#173177"]
  301. ]
  302. ];
  303. $data['miniprogram']['appid'] = $wx['miniAppId'];
  304. $data['miniprogram']['pagepath'] = 'pagesPurchase/purDetails?id=' . $orderId;
  305. wxUtil::sendTaskInform($data, $wx, $ptStyle);
  306. }
  307. }
  308. //零售清算欠款通知供应商 shish 20210531
  309. public static function clearInform($shop, $order, $custom)
  310. {
  311. $shopId = $shop->id;
  312. $ptStyle = $shop->ptStyle;
  313. $wxBase = WxOpenClass::getWxBase();
  314. $wx = $wxBase[$ptStyle] ?? [];
  315. $message = self::getAllByCondition(['ptStyle' => $ptStyle], null, '*', 'shortTemplateId');
  316. $shortTempId = 'OPENTM207422813';//收入提醒
  317. $tempId = isset($message[$shortTempId]['templateId']) ? $message[$shortTempId]['templateId'] : '';
  318. if (empty($tempId)) {
  319. return false;
  320. }
  321. $actPrice = $order->actPrice;
  322. $name = $custom->name ?? '';
  323. $customId = $custom->id;
  324. $adminList = ShopAdminClass::getRemainAdmin($shopId);
  325. foreach ($adminList as $admin) {
  326. if (isset($admin['subscribe']) == false || $admin['subscribe'] == 0) {
  327. continue;
  328. }
  329. $openId = isset($admin['openId']) ? $admin['openId'] : '';
  330. $data = [
  331. "touser" => $openId,
  332. "template_id" => $tempId,
  333. "url" => Yii::$app->params['ghsDomain'],
  334. "data" => [
  335. "first" => ["value" => "客户{$name}结款{$actPrice}元", "color" => "#173177"],
  336. "keyword1" => ["value" => $actPrice, "color" => "#173177"],
  337. "keyword2" => ["value" => '客户结款', "color" => "#173177"],
  338. "keyword3" => ["value" => date("Y-m-d H:i"), "color" => "#173177"],
  339. "remark" => ["value" => "点击查看详情", "color" => "#173177"]
  340. ]
  341. ];
  342. $data['miniprogram']['appid'] = $wx['miniAppId'];
  343. $data['miniprogram']['pagepath'] = 'pagesArrears/details?id=' . $customId;
  344. wxUtil::sendTaskInform($data, $wx, $ptStyle);
  345. }
  346. }
  347. //收款码收入通知 shish 20210531
  348. public static function gatheringIncomeInform($shop, $order)
  349. {
  350. $shopId = $shop->id;
  351. $ptStyle = $shop->ptStyle;
  352. $wxBase = WxOpenClass::getWxBase();
  353. $wx = $wxBase[$ptStyle] ?? [];
  354. $message = self::getAllByCondition(['ptStyle' => $ptStyle], null, '*', 'shortTemplateId');
  355. $shortTempId = 'OPENTM207422813';//收入提醒
  356. $tempId = isset($message[$shortTempId]['templateId']) ? $message[$shortTempId]['templateId'] : '';
  357. if (empty($tempId)) {
  358. return false;
  359. }
  360. $actPrice = $order->actPrice;
  361. $orderId = $order->id;
  362. $adminList = ShopAdminClass::getRemainAdmin($shopId);
  363. foreach ($adminList as $admin) {
  364. if (isset($admin['subscribe']) == false || $admin['subscribe'] == 0) {
  365. continue;
  366. }
  367. $openId = isset($admin['openId']) ? $admin['openId'] : '';
  368. $data = [
  369. "touser" => $openId,
  370. "template_id" => $tempId,
  371. "url" => Yii::$app->params['ghsDomain'],
  372. "data" => [
  373. "first" => ["value" => "您有新的收入。", "color" => "#173177"],
  374. "keyword1" => ["value" => $actPrice, "color" => "#173177"],
  375. "keyword2" => ["value" => '二维码收款', "color" => "#173177"],
  376. "keyword3" => ["value" => date("Y-m-d H:i"), "color" => "#173177"],
  377. "remark" => ["value" => "点击查看详情", "color" => "#173177"]
  378. ]
  379. ];
  380. $data['miniprogram']['appid'] = $wx['miniAppId'];
  381. $data['miniprogram']['pagepath'] = 'admin/order/detail?id=' . $orderId;
  382. wxUtil::sendTaskInform($data, $wx, $ptStyle);
  383. }
  384. }
  385. //提现成功通知 shish 20210531
  386. public static function cashInform($shop, $cash)
  387. {
  388. $shopId = $shop->id;
  389. $ptStyle = $shop->ptStyle;
  390. $wxBase = WxOpenClass::getWxBase();
  391. $wx = $wxBase[$ptStyle] ?? [];
  392. $message = self::getAllByCondition(['ptStyle' => $ptStyle], null, '*', 'shortTemplateId');
  393. $shortTempId = 'OPENTM411207151';
  394. $tempId = isset($message[$shortTempId]['templateId']) ? $message[$shortTempId]['templateId'] : '';
  395. if (empty($tempId)) {
  396. return false;
  397. }
  398. $amount = $cash->amount;
  399. $adminList = ShopAdminClass::getRemainAdmin($shopId);
  400. foreach ($adminList as $admin) {
  401. if (isset($admin['subscribe']) == false || $admin['subscribe'] == 0) {
  402. continue;
  403. }
  404. $openId = isset($admin['openId']) ? $admin['openId'] : '';
  405. $data = [
  406. "touser" => $openId,
  407. "template_id" => $tempId,
  408. "url" => Yii::$app->params['ghsDomain'],
  409. "data" => [
  410. "first" => ["value" => "您的提现已经到帐。", "color" => "#173177"],
  411. "keyword1" => ["value" => $amount, "color" => "#173177"],
  412. "keyword2" => ["value" => date("Y-m-d H:i"), "color" => "#173177"],
  413. "remark" => ["value" => "感谢您的使用", "color" => "#173177"]
  414. ]
  415. ];
  416. $data['miniprogram']['appid'] = $wx['miniAppId'];
  417. $data['miniprogram']['pagepath'] = 'pagesStore/me/withdraw';
  418. wxUtil::sendTaskInform($data, $wx, $ptStyle);
  419. }
  420. }
  421. //订单送达通知 shish 20210607
  422. public static function reachInform($shop, $order)
  423. {
  424. $shopId = $shop->id;
  425. $ptStyle = $shop->ptStyle;
  426. $wxBase = WxOpenClass::getWxBase();
  427. $wx = $wxBase[$ptStyle] ?? [];
  428. $message = self::getAllByCondition(['ptStyle' => $ptStyle], null, '*', 'shortTemplateId');
  429. $shortTempId = 'OPENTM201205968';
  430. $tempId = isset($message[$shortTempId]['templateId']) ? $message[$shortTempId]['templateId'] : '';
  431. if (empty($tempId)) {
  432. return false;
  433. }
  434. $orderId = $order->id ?? '';
  435. $orderSn = (string)$order->orderSn ?? '';
  436. $customName = $order->customName ?? '';
  437. $adminList = ShopAdminClass::getRemainAdmin($shopId);
  438. foreach ($adminList as $admin) {
  439. if (isset($admin['subscribe']) == false || $admin['subscribe'] == 0) {
  440. continue;
  441. }
  442. $openId = isset($admin['openId']) ? $admin['openId'] : '';
  443. $data = [
  444. "touser" => $openId,
  445. "template_id" => $tempId,
  446. "url" => Yii::$app->params['ghsDomain'],
  447. "data" => [
  448. "first" => ["value" => '客户订单已送达', "color" => "#173177"],
  449. "keyword1" => ["value" => $orderSn, "color" => "#173177"],
  450. "keyword2" => ["value" => $customName, "color" => "#173177"],
  451. "keyword3" => ["value" => '已送达', "color" => "#173177"],
  452. "remark" => ["value" => '点击查看详情', "color" => "#173177"]
  453. ]
  454. ];
  455. $data['miniprogram']['appid'] = $wx['miniAppId'];
  456. $data['miniprogram']['pagepath'] = 'pagesOrder/detail?id=' . $orderId;
  457. wxUtil::sendTaskInform($data, $wx, $ptStyle);
  458. }
  459. }
  460. //采购退款成功通知 shish 20210730
  461. public static function cgRefundInform($shop, $cg, $amount)
  462. {
  463. $shopId = $shop->id;
  464. $ptStyle = $shop->ptStyle;
  465. $wxBase = WxOpenClass::getWxBase();
  466. $wx = $wxBase[$ptStyle] ?? [];
  467. $message = self::getAllByCondition(['ptStyle' => $ptStyle], null, '*', 'shortTemplateId');
  468. $shortTempId = 'OPENTM407280253';
  469. $tempId = isset($message[$shortTempId]['templateId']) ? $message[$shortTempId]['templateId'] : '';
  470. if (empty($tempId)) {
  471. return false;
  472. }
  473. $orderId = $cg->id ?? '';
  474. $orderSn = (string)$cg->orderSn ?? '';
  475. $adminList = ShopAdminClass::getRemainAdmin($shopId);
  476. foreach ($adminList as $admin) {
  477. if (isset($admin['subscribe']) == false || $admin['subscribe'] == 0) {
  478. continue;
  479. }
  480. $openId = isset($admin['openId']) ? $admin['openId'] : '';
  481. $data = [
  482. "touser" => $openId,
  483. "template_id" => $tempId,
  484. "url" => Yii::$app->params['ghsDomain'],
  485. "data" => [
  486. "first" => ["value" => '采购单:' . $orderSn, "color" => "#173177"],
  487. "keyword1" => ["value" => "订单退款", "color" => "#173177"],
  488. "keyword2" => ["value" => $amount . "元", "color" => "#173177"],
  489. "keyword3" => ["value" => '已送达', "color" => "#173177"],
  490. "remark" => ["value" => '点击查看详情', "color" => "#173177"]
  491. ]
  492. ];
  493. $data['miniprogram']['appid'] = $wx['miniAppId'];
  494. $data['miniprogram']['pagepath'] = 'pagesPurchase/purDetails?id=' . $orderId;
  495. wxUtil::sendTaskInform($data, $wx, $ptStyle);
  496. }
  497. }
  498. }