redis->executeCommand('LLEN', [$noticeKey])) { $json = Yii::$app->redis->executeCommand('RPOP', [$noticeKey]); //$json = '{"id":163,"num":"1","shopId":36523}'; if (!empty($json)) { $arr = json_decode($json, true); $id = $arr['id'] ?? 0; $num = $arr['num'] ?? 0; $shopId = $arr['shopId'] ?? 0; $res = BookItemCustomClass::getById($id, true); if (!empty($res)) { $shop = \biz\shop\classes\ShopClass::getById($shopId, true); WxMessageClass::bookChangeOutStockInform($shop, $res, $num); } } } } //花店采购通知供货商 ssh 20230805 public function actionHdCgNoticeGhs() { $noticeKey = "hdCgNoticeGhs"; while ($count = Yii::$app->redis->executeCommand('LLEN', [$noticeKey])) { $json = Yii::$app->redis->executeCommand('RPOP', [$noticeKey]); if (!empty($json)) { $arr = json_decode($json, true); $orderId = $arr['orderId'] ?? 0; if (!empty($orderId)) { $order = OrderClass::getById($orderId, true); $shopId = $order->shopId ?? 0; $shop = ShopClass::getById($shopId, true); if (!empty($shop)) { WxMessageClass::ghsHasNewOrderInform($shop, $order); // 向供货商App发通知 $allDevices = \bizGhs\device\classes\GhsDeviceClass::getAllByCondition(['shopId'=>$shopId]); $cids = array_column($allDevices, 'clientId'); $title = '你有新的订单'; $content = $shop->shopName . ' ¥' . $order->actPrice; $payload = [ "page" => "pagesOrder/detail", "params" => ["id" => $order->id] ]; $push = new \common\components\push('ghs'); $rs = $push->pushByCloud($cids, $title, $content, $payload); } } } } } //预订增加减少通知 ssh 20240820 public function actionBookChangeNotice() { $noticeKey = "bookChangeNoticeStaff"; while ($count = Yii::$app->redis->executeCommand('LLEN', [$noticeKey])) { $json = Yii::$app->redis->executeCommand('RPOP', [$noticeKey]); if (!empty($json)) { $arr = json_decode($json, true); $shopId = $arr['shopId'] ?? 0; if (!empty($shopId)) { $shop = ShopClass::getById($shopId, true); if (!empty($shop)) { WxMessageClass::bookChangeInform($shop, $arr); } } } } } //供货商开单通知花店 ssh 20231129 public function actionGhsKdNoticeHd() { $noticeKey = "ghsKdNoticeHd"; while ($count = Yii::$app->redis->executeCommand('LLEN', [$noticeKey])) { $json = Yii::$app->redis->executeCommand('RPOP', [$noticeKey]); if (!empty($json)) { $arr = json_decode($json, true); $id = $arr['id'] ?? 0; if (!empty($id)) { $cg = PurchaseClass::getById($id, true); $shopId = $cg->shopId ?? 0; $shop = ShopClass::getById($shopId, true); if (!empty($shop)) { WxMessageClass::hdNewCgOrderInform($shop, $cg); } } } } } }