diff --git a/scripts/orderDetailUpdate.php b/scripts/orderDetailUpdate.php index 55699d1..ca6d340 100644 --- a/scripts/orderDetailUpdate.php +++ b/scripts/orderDetailUpdate.php @@ -4,6 +4,7 @@ require_once __DIR__ . '/../vendor/autoload.php'; require_once __DIR__ . '/../support/bootstrap.php'; use ba\Random; +use extend\workermans\model\Base; use PhpAmqpLib\Connection\AMQPStreamConnection; use support\think\Db; use support\Log; @@ -37,19 +38,21 @@ use support\Redis; $date_time = date('Y-m-d H:i:s'); $data = $msg->body; Log::info('MQ收到消息[商品状态更新]--->' . $data . '--->' . $date_time . "\n"); + $datInfo= json_decode($data, true); // 如果是数字。则打印订单 $is_log = false; $curl_error = ''; $rand = 'product_update' . Random::build(); - $send_id = 'cart_update' . $data . '_all' ; + $send_id = Base::get_shopping_save_uid($datInfo['shopId'], 'all'); $snd_data =[ 'msg' => '购物车刷新', 'operate_type' => 'reload', 'msg_id' => $rand, - 'type' => 'bc', + 'type' => $datInfo['type'], 'data_type' => 'cart', 'status' => 1 ]; + Log::info('推送组'.$send_id.'内容'.json_encode($snd_data)); $snd_data_json = json_encode($snd_data); Gateway::$registerAddress = '127.0.0.1:1238'; $res = Gateway::sendToGroup($send_id, $snd_data_json);