|
|
@@ -15,19 +15,21 @@ class MqController extends Controller
|
|
|
public function actionHdCgNoticeGhs()
|
|
|
{
|
|
|
$noticeKey = "hdCgNoticeGhs";
|
|
|
- $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);
|
|
|
+ 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);
|
|
|
+ }
|
|
|
}
|
|
|
+ print_r($arr);
|
|
|
}
|
|
|
- print_r($arr);
|
|
|
}
|
|
|
}
|
|
|
|