sendNum ?? 0; $sound = '请注意,' . $sendNum . '号单有修改'; if ($order->fromType == 4) { $mtSn = $order->thirdSn ?? 0; $sound = '请注意,美团' . $mtSn . '号单有修改'; } $hasSh = 0; $hasHs = 0; $workList = WorkClass::getAllByCondition(['orderId' => $order->id], null, '*', null, true); if (!empty($workList)) { foreach ($workList as $work) { if ($work->status == 0) { $sh = $work->sh ?? 0; if ($sh == 0) { $hasHs = 1; } else { $hasSh = 1; } } } } if ($hasHs == 1) { $lbSn = $order->fromType == 4 ? $shopExt->mtLbSn : $shopExt->makeLbSn; $lbVersion = $order->fromType == 4 ? $shopExt->mtLbVersion : $shopExt->makeLbVersion; $url = "https://speaker.17laimai.cn/notify.php?id={$lbSn}&token=HK1626595800&version={$lbVersion}&message=" . $sound; $curl = new curl\Curl(); $curl->get($url); } if ($hasSh == 1) { $lbSn = $shopExt->lbSn ?? ''; $lbVersion = $shopExt->lbVersion; $url = "https://speaker.17laimai.cn/notify.php?id={$lbSn}&token=HK1626595800&version={$lbVersion}&message=" . $sound; $curl = new curl\Curl(); $curl->get($url); } } public static function orderCancelRemind($shopExt, $order) { $sendNum = $order->sendNum ?? 0; $hasSh = 0; $hasHs = 0; $workList = WorkClass::getAllByCondition(['orderId' => $order->id], null, '*', null, true); if (!empty($workList)) { foreach ($workList as $work) { if ($work->status == 2) { $sh = $work->sh ?? 0; if ($sh == 0) { $hasHs = 1; } else { $hasSh = 1; } $sound = '请注意,' . $sendNum . '号单已被取消'; if ($order->fromType == 4) { $mtSn = $order->thirdSn ?? 0; $sound = '请注意,美团' . $mtSn . '号单已被取消'; } } if ($work->preNum > $work->num && $work->status == 0) { $sh = $work->sh ?? 0; if ($sh == 0) { $hasHs = 1; } else { $hasSh = 1; } $sound = '请注意,' . $sendNum . '号单有修改'; if ($order->fromType == 4) { $mtSn = $order->thirdSn ?? 0; $sound = '请注意,美团' . $mtSn . '号单有修改'; } } } } if ($hasHs == 1) { $lbSn = $order->fromType == 4 ? $shopExt->mtLbSn : $shopExt->makeLbSn; $lbVersion = $order->fromType == 4 ? $shopExt->mtLbVersion : $shopExt->makeLbVersion; $url = "https://speaker.17laimai.cn/notify.php?id={$lbSn}&token=HK1626595800&version={$lbVersion}&message=" . $sound; $curl = new curl\Curl(); $curl->get($url); } if ($hasSh == 1) { $lbSn = $shopExt->lbSn ?? ''; $lbVersion = $shopExt->lbVersion; $url = "https://speaker.17laimai.cn/notify.php?id={$lbSn}&token=HK1626595800&version={$lbVersion}&message=" . $sound; $curl = new curl\Curl(); $curl->get($url); } } //新的制作单提示 public static function newWorkRemind($shopExt, $order) { $id = $order->id ?? 0; $list = WorkClass::getAllByCondition(['orderId' => $id], null, '*', null, true); if (empty($list)) { //提示有订单,但没有生成制作单 if (isset($order->shopAdminId) == false || empty($order->shopAdminId)) { //$lbSn = $order->fromType == 4 ? $shopExt->mtLbSn : $shopExt->makeLbSn; //$lbVersion = $order->fromType == 4 ? $shopExt->mtLbVersion : $shopExt->makeLbVersion; if (!empty($lbSn)) { //$sound = "您有新订单,编号{$order->sendNum},因还有库存,没有生成制作单"; //$url = "https://speaker.17laimai.cn/notify.php?id={$lbSn}&token=HK1626595800&version={$lbVersion}&message=" . $sound; //$curl = new curl\Curl(); //$curl->get($url); } //noticeUtil::push("订单id:{$id} 因还有库存,没有生成制作单,请跟进", '15280215347'); } } else { //散花 $sh = 0; //花束 $hs = 0; foreach ($list as $work) { if ($work->sh == 1) { $sh = 1; } else { $hs = 1; } } if ($sh == 1) { $lbSn = $shopExt->lbSn ?? ''; $lbVersion = $shopExt->lbVersion ?? ''; if (!empty($lbSn)) { $sound = "您有新的散花订单"; $reachDate = $order->reachDate ?? ''; if ($order->sendType == 1) { if (!empty($reachDate) && $reachDate != '0000-00-00') { $readPeriod = $order->reachPeriod ?? 0; $period = explode(':', $readPeriod); $periodName = implode($period, '点'); if ($reachDate == date("Y-m-d")) { $sound .= ',今天' . $periodName . "分客户到店自取"; } elseif ($reachDate == date("Y-m-d", strtotime("+1 day"))) { $sound .= ',明天' . $periodName . "分客户到店自取"; } elseif ($reachDate == date("Y-m-d", strtotime("+2 day"))) { $sound .= ',后天' . $periodName . "分客户到店自取"; } else { $sound .= ',' . date("d", strtotime($reachDate)) . '号' . $periodName . "分客户到店自取"; } } else { $sound .= ",客户到店自取"; } } else { if (!empty($reachDate) && $reachDate != '0000-00-00') { $readPeriod = $order->reachPeriod ?? 0; $period = explode(':', $readPeriod); $periodName = implode($period, '点'); if ($reachDate == date("Y-m-d")) { $sound .= ',今天' . $periodName . "分前送达"; } elseif ($reachDate == date("Y-m-d", strtotime("+1 day"))) { $sound .= ',明天' . $periodName . "分前送达"; } elseif ($reachDate == date("Y-m-d", strtotime("+2 day"))) { $sound .= ',后天' . $periodName . "分前送达"; } else { $sound .= date("d", strtotime($reachDate)) . '号' . $periodName . "分前送达"; } } } $url = "https://speaker.17laimai.cn/notify.php?id={$lbSn}&token=HK1626595800&version={$lbVersion}&message=" . $sound; $curl = new curl\Curl(); $curl->get($url); } } if ($hs == 1) { $lbSn = $order->fromType == 4 ? $shopExt->mtLbSn : $shopExt->makeLbSn; $lbVersion = $order->fromType == 4 ? $shopExt->mtLbVersion : $shopExt->makeLbVersion; if (!empty($lbSn)) { $sound = "您有新的制作单"; $reachDate = $order->reachDate ?? ''; if ($order->sendType == 1) { if (!empty($reachDate) && $reachDate != '0000-00-00') { $readPeriod = $order->reachPeriod ?? 0; $period = explode(':', $readPeriod); $periodName = implode($period, '点'); if ($reachDate == date("Y-m-d")) { $sound .= ',今天' . $periodName . "分客户到店自取"; } elseif ($reachDate == date("Y-m-d", strtotime("+1 day"))) { $sound .= ',明天' . $periodName . "分客户到店自取"; } elseif ($reachDate == date("Y-m-d", strtotime("+2 day"))) { $sound .= ',后天' . $periodName . "分客户到店自取"; } else { $sound .= ',' . date("d", strtotime($reachDate)) . '号' . $periodName . "分客户到店自取"; } } else { $sound .= ",客户到店自取"; } } else { if (!empty($reachDate) && $reachDate != '0000-00-00') { $readPeriod = $order->reachPeriod ?? 0; $period = explode(':', $readPeriod); $periodName = implode($period, '点'); if ($reachDate == date("Y-m-d")) { $sound .= ',今天' . $periodName . "分前送达"; } elseif ($reachDate == date("Y-m-d", strtotime("+1 day"))) { $sound .= ',明天' . $periodName . "分前送达"; } elseif ($reachDate == date("Y-m-d", strtotime("+2 day"))) { $sound .= ',后天' . $periodName . "分前送达"; } else { $sound .= date("d", strtotime($reachDate)) . '号' . $periodName . "分前送达"; } } } $url = "https://speaker.17laimai.cn/notify.php?id={$lbSn}&token=HK1626595800&version={$lbVersion}&message=" . $sound; $curl = new curl\Curl(); $curl->get($url); $curl->get($url); } } } } //花店采购供货商端播放声音 public static function hdCgGhsReport($orderSn) { $cg = PurchaseClass::getByCondition(['orderSn' => $orderSn], true); if (isset($cg->onlinePay) && $cg->onlinePay == dict::getDict('onlinePay', 'yes')) { $saleId = $cg->saleId ?? 0; $order = \bizGhs\order\classes\OrderClass::getById($saleId, true); if (isset($order->needPrint) && $order->needPrint == dict::getDict('needPrint', 'noNeed')) { $shopId = $order->shopId ?? 0; $shopExt = ShopExtClass::getByCondition(['shopId' => $shopId], true); if (isset($shopExt->lbSn) && !empty($shopExt->lbSn)) { $actPrice = floatval($order->actPrice) ?? 0; $payWay = $order->payWay ?? dict::getDict('payWay', 'wxPay'); $sound = $payWay == dict::getDict('payWay', 'wxPay') ? "微信收款{$actPrice}元" : "支付宝收款{$actPrice}元"; $url = "https://speaker.17laimai.cn/notify.php?id={$shopExt->lbSn}&token=HK1626595800&version={$shopExt->lbVersion}&message=" . $sound; $curl = new curl\Curl(); $curl->get($url); } } //app新订单通知 //NoticeClass::ghsNewOrderNotice($order); } } public static function pleasePayReport($order) { $shopId = $order->shopId ?? 0; $shopExt = ShopExtClass::getByCondition(['shopId' => $shopId], true); if (isset($shopExt->lbSn) && !empty($shopExt->lbSn)) { $mainPay = $order->mainPay ? floatval($order->mainPay) : 0; $sound = $mainPay . '元,请出示付款码'; $url = "https://speaker.17laimai.cn/notify.php?id={$shopExt->lbSn}&token=HK1626595800&version={$shopExt->lbVersion}&message=" . $sound; $curl = new curl\Curl(); $curl->get($url); } } //供货商收银台 ssh 20230421 public static function ghsPleasePayReport($order) { $shopId = $order->shopId ?? 0; $shopExt = ShopExtClass::getByCondition(['shopId' => $shopId], true); if (isset($shopExt->lbSn) && !empty($shopExt->lbSn)) { $mainPay = $order->actPrice ? floatval($order->actPrice) : 0; $sound = $mainPay . '元,请出示付款码'; $url = "https://speaker.17laimai.cn/notify.php?id={$shopExt->lbSn}&token=HK1626595800&version={$shopExt->lbVersion}&message=" . $sound; $curl = new curl\Curl(); $curl->get($url); } } //零售花店收款声音播放 ssh 20220423 public static function hdGatheringReport($order) { if ($order->fromType != dict::getDict("fromType", "shop")) { //非门店订单不播报语音 return false; } if ($order->onlinePay == dict::getDict('onlinePay', 'not')) { //非在线支付的不播报 return false; } if ($order->payStatus != 1) { //还没有付款订单不播报 return false; } $shopId = $order->shopId ?? 0; $shopExt = ShopExtClass::getByCondition(['shopId' => $shopId], true); if (isset($shopExt->lbSn) && !empty($shopExt->lbSn)) { $actPrice = $order->mainPay ? floatval($order->mainPay) : 0; $payWay = $order->payWay ?? dict::getDict('payWay', 'wxPay'); $sound = $payWay == dict::getDict('payWay', 'wxPay') ? "微信收款{$actPrice}元,谢谢惠顾,欢迎下次光临" : "支付宝收款{$actPrice}元,谢谢惠顾,欢迎下次光临"; $url = "https://speaker.17laimai.cn/notify.php?id={$shopExt->lbSn}&token=HK1626595800&version={$shopExt->lbVersion}&message=" . $sound; $curl = new curl\Curl(); $curl->get($url); } } public static function hdScanPayReport($order) { if (empty($order)) { return false; } if ($order->payStatus != 1) { //还没有付款订单不播报 return false; } $shopId = $order->shopId ?? 0; $shopExt = ShopExtClass::getByCondition(['shopId' => $shopId], true); if (!empty($shopExt->lbSn)) { $actPrice = $order->actPrice ?? 0; $payWay = $order->payWay ?? 0; $sound = $payWay == 0 ? "微信收款{$actPrice}元,谢谢惠顾,欢迎下次光临" : "支付宝收款{$actPrice}元,谢谢惠顾,欢迎下次光临"; $url = "https://speaker.17laimai.cn/notify.php?id={$shopExt->lbSn}&token=HK1626595800&version={$shopExt->lbVersion}&message=" . $sound; $curl = new curl\Curl(); $curl->get($url); } } //供货商收款声音播放 ssh 20230421 public static function ghsGatheringReport($order) { if ($order->fromType != dict::getDict("fromType", "shop")) { //非门店订单不播报语音 return false; } if ($order->onlinePay == dict::getDict('onlinePay', 'not')) { //非在线支付的不播报 return false; } if ($order->payStatus != 1) { //还没有付款订单不播报 return false; } $shopId = $order->shopId ?? 0; $shopExt = ShopExtClass::getByCondition(['shopId' => $shopId], true); if (isset($shopExt->lbSn) && !empty($shopExt->lbSn)) { $actPrice = $order->actPrice ? floatval($order->actPrice) : 0; $payWay = $order->payWay ?? dict::getDict('payWay', 'wxPay'); $sound = $payWay == dict::getDict('payWay', 'wxPay') ? "微信收款{$actPrice}元,谢谢惠顾,欢迎下次光临" : "支付宝收款{$actPrice}元,谢谢惠顾,欢迎下次光临"; $url = "https://speaker.17laimai.cn/notify.php?id={$shopExt->lbSn}&token=HK1626595800&version={$shopExt->lbVersion}&message=" . $sound; $curl = new curl\Curl(); $curl->get($url); } } //订单取消,钱原路退回,提醒客户 public static function orderCancelBackMoneyReport($shopId) { $shopExt = ShopExtClass::getByCondition(['shopId' => $shopId], true); if (!empty($shopExt->lbSn)) { $sound = "订单已取消,付款已原路退回,请稍等几秒重新付款"; $url = "https://speaker.17laimai.cn/notify.php?id={$shopExt->lbSn}&token=HK1626595800&version={$shopExt->lbVersion}&message=" . $sound; $curl = new curl\Curl(); $curl->get($url); } } //提醒输入密码 ssh 20250501 public static function remindInputPassword($shopId) { $shopExt = ShopExtClass::getByCondition(['shopId' => $shopId], true); if (!empty($shopExt->lbSn)) { $sound = "请输入密码"; $url = "https://speaker.17laimai.cn/notify.php?id={$shopExt->lbSn}&token=HK1626595800&version={$shopExt->lbVersion}&message=" . $sound; $curl = new curl\Curl(); $curl->get($url); } } //清除所有小菊 public static function clearXjALl($shopId) { $where = []; $where['shopId'] = $shopId; return self::updateByCondition($where, ['xj' => '']); } }