|
|
@@ -1346,4 +1346,47 @@ class WxMessageClass extends BaseClass
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ //预订变化通知供货商员工下架花材 ssh 20240729
|
|
|
+ public static function bookChangeOutStockInform($shop, $bookItemCustomRes, $num)
|
|
|
+ {
|
|
|
+ $ptStyle = $shop->ptStyle;
|
|
|
+ $wxBase = WxOpenClass::getWxBase();
|
|
|
+ $wx = $wxBase[$ptStyle] ?? [];
|
|
|
+ $message = self::getAllByCondition(['ptStyle' => $ptStyle], null, '*', 'shortTemplateId');
|
|
|
+ //取货提醒
|
|
|
+ $shortTempId = 'ZHH202407100108';
|
|
|
+ $tempId = isset($message[$shortTempId]['templateId']) ? $message[$shortTempId]['templateId'] : '';
|
|
|
+ if (empty($tempId)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ $adminList = ShopAdminClass::getRemainAdmin($shop);
|
|
|
+ if (empty($adminList)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ $itemId = $bookItemCustomRes->itemId ?? 0;
|
|
|
+ $itemName = $bookItemCustomRes->name ?? '';
|
|
|
+ $customName = $bookItemCustomRes->customName ?? '';
|
|
|
+ $seatSn = $bookItemCustomRes->seatSn ?? 0;
|
|
|
+ $seatName = empty($seatSn) ? '' : '货位号' . $seatSn;
|
|
|
+ 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" => [
|
|
|
+ "thing8" => ["value" => $customName],
|
|
|
+ "thing10" => ["value" => $seatName],
|
|
|
+ "thing7" => ["value" => $itemName . ' ' . $num . '份'],
|
|
|
+ ]
|
|
|
+ ];
|
|
|
+ $data['miniprogram']['appid'] = $wx['miniAppId'];
|
|
|
+ $data['miniprogram']['pagepath'] = 'admin/book/itemCustom?itemId=' . $itemId . '&itemName=' . $itemName;
|
|
|
+ wxUtil::sendTaskInform($data, $wx, $ptStyle);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|