|
|
@@ -104,126 +104,54 @@ class ShopExtClass extends BaseClass
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- //新的制作单提示
|
|
|
+ //新制作单提示
|
|
|
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);
|
|
|
+ $lbSn = $order->fromType == 4 ? $shopExt->mtLbSn : $shopExt->makeLbSn;
|
|
|
+ $lbVersion = $order->fromType == 4 ? $shopExt->mtLbVersion : $shopExt->makeLbVersion;
|
|
|
+ if (empty($lbSn)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ $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 . "分到店自取";
|
|
|
}
|
|
|
- //noticeUtil::push("订单id:{$id} 因还有库存,没有生成制作单,请跟进", '15280215347');
|
|
|
+ } else {
|
|
|
+ $sound .= ",客户到店自取";
|
|
|
}
|
|
|
} else {
|
|
|
- //散花
|
|
|
- $sh = 0;
|
|
|
- //花束
|
|
|
- $hs = 0;
|
|
|
- foreach ($list as $work) {
|
|
|
- if ($work->sh == 1) {
|
|
|
- $sh = 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 {
|
|
|
- $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);
|
|
|
+ $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);
|
|
|
+ return true;
|
|
|
}
|
|
|
|
|
|
//花店采购供货商端播放声音
|