|
|
@@ -224,6 +224,61 @@ class WxMessageClass extends BaseClass
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ //客户充值清账通知 ssh 20240511
|
|
|
+ public static function customRechargeClearInform($shop, $recharge)
|
|
|
+ {
|
|
|
+ //充值金额 商品名称 姓名 操作人 充值时间
|
|
|
+ $orderSn = $recharge->orderSn ?? '';
|
|
|
+ $ptStyle = $shop->ptStyle;
|
|
|
+ $amount = $recharge->actPrice ?? 0;
|
|
|
+ $staffName = $recharge->staffName ?? '';
|
|
|
+ $onlinePay = $recharge->onlinePay ?? 1;
|
|
|
+ $onlineName = $onlinePay == 1 ? '线下' : '线上';
|
|
|
+ $payWay = $recharge->payWay ?? 0;
|
|
|
+ $nameMap = dict::getDict('payWayName');
|
|
|
+ $payWayName = $nameMap[$payWay] ?? '微信';
|
|
|
+ $payName = $onlineName . $payWayName;
|
|
|
+ $title = $payName . '-充值销账';
|
|
|
+ $customName = $recharge->customName ?? '';
|
|
|
+ $payTime = $recharge->payTime ?? '';
|
|
|
+
|
|
|
+ $wxBase = WxOpenClass::getWxBase();
|
|
|
+ $wx = $wxBase[$ptStyle] ?? [];
|
|
|
+ $message = self::getAllByCondition(['ptStyle' => $ptStyle], null, '*', 'shortTemplateId');
|
|
|
+ $shortTempId = 'ZHH202405111704';
|
|
|
+ $tempId = isset($message[$shortTempId]['templateId']) ? $message[$shortTempId]['templateId'] : '';
|
|
|
+ if (empty($tempId)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ $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'] : '';
|
|
|
+ }
|
|
|
+ if (!empty($openId)) {
|
|
|
+ $data = [
|
|
|
+ "touser" => $openId,
|
|
|
+ "template_id" => $tempId,
|
|
|
+ "url" => Yii::$app->params['ghsDomain'],
|
|
|
+ "data" => [
|
|
|
+ "amount1" => ["value" => $amount],
|
|
|
+ "thing9" => ["value" => $title],
|
|
|
+ "thing7" => ["value" => $customName],
|
|
|
+ "thing11" => ["value" => $staffName],
|
|
|
+ "time3" => ["value" => $payTime],
|
|
|
+ ]
|
|
|
+ ];
|
|
|
+ $data['miniprogram']['appid'] = $wx['miniAppId'];
|
|
|
+ $data['miniprogram']['pagepath'] = 'pagesPurchase/info?orderSn=' . $orderSn;
|
|
|
+ wxUtil::sendTaskInform($data, $wx, $ptStyle);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
//供货商重复打印通知 ssh 20240511
|
|
|
public static function ghsCgRepeatPrintInform($cg)
|
|
|
{
|