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