上菜状态推送
This commit is contained in:
@@ -42,7 +42,6 @@ use support\Redis;
|
|||||||
$curl_error = '';
|
$curl_error = '';
|
||||||
$rand = 'product_update' . Random::build();
|
$rand = 'product_update' . Random::build();
|
||||||
$send_id = 'cart_update' . $data . '_all' ;
|
$send_id = 'cart_update' . $data . '_all' ;
|
||||||
$method = 'sendToGroup';
|
|
||||||
$snd_data =[
|
$snd_data =[
|
||||||
'msg' => '购物车刷新',
|
'msg' => '购物车刷新',
|
||||||
'operate_type' => 'reload',
|
'operate_type' => 'reload',
|
||||||
@@ -55,19 +54,6 @@ use support\Redis;
|
|||||||
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);
|
||||||
Log::info('商品状态更新推送结果-->' . $res);
|
Log::info('商品状态更新推送结果-->' . $res);
|
||||||
$result = Redis::get($snd_data['send_id']);
|
|
||||||
if($result) {
|
|
||||||
$msg_id_arr = json_decode($result, true);
|
|
||||||
$msg_id_arr_c = count($msg_id_arr);
|
|
||||||
$msg_id_arr[$msg_id_arr_c] = $snd_data;
|
|
||||||
$result_n = json_encode($msg_id_arr);
|
|
||||||
\extend\workermans\model\Base::setredis_new($result_n, $snd_data['send_id']);
|
|
||||||
}else {
|
|
||||||
$params_arr_n[] = $snd_data;
|
|
||||||
print_r('数组-------->' . json_encode($params_arr_n)) . "\r\n";
|
|
||||||
\extend\workermans\model\Base::setredis_new(json_encode($params_arr_n), $snd_data['send_id']);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if($is_log) {
|
if($is_log) {
|
||||||
Db::table('tb_mq_log')->insert([
|
Db::table('tb_mq_log')->insert([
|
||||||
|
|||||||
Reference in New Issue
Block a user