redis edit
This commit is contained in:
@@ -4,6 +4,7 @@ namespace extend\workermans\model;
|
|||||||
|
|
||||||
use ba\Exception;
|
use ba\Exception;
|
||||||
use ba\Random;
|
use ba\Random;
|
||||||
|
use support\Redis;
|
||||||
use support\think\Db;
|
use support\think\Db;
|
||||||
use GatewayWorker\Lib\Gateway;
|
use GatewayWorker\Lib\Gateway;
|
||||||
Use support\Log;
|
Use support\Log;
|
||||||
@@ -67,10 +68,9 @@ class Cashier extends Base
|
|||||||
self::gateway_query('sendToClient', [$client_id, json_encode($snd_data)]);
|
self::gateway_query('sendToClient', [$client_id, json_encode($snd_data)]);
|
||||||
|
|
||||||
$uid = $message['account'];
|
$uid = $message['account'];
|
||||||
$redis = self::$redis;
|
|
||||||
$gateway = Gateway::class;
|
$gateway = Gateway::class;
|
||||||
// 处理打印消息
|
// 处理打印消息
|
||||||
$redis->get($uid, function ($result, $redis) use($gateway, $uid){
|
$result = Redis::get($uid);
|
||||||
if($result) {
|
if($result) {
|
||||||
$msg_info_arr = json_decode($result, true);
|
$msg_info_arr = json_decode($result, true);
|
||||||
$arr_n = [];
|
$arr_n = [];
|
||||||
@@ -85,9 +85,8 @@ class Cashier extends Base
|
|||||||
self::add_log_file('----离线后推送收银机订单打印无回执--' .date('Y-m-d H:i:s'). '--->' . $arr_json, 'cashier');
|
self::add_log_file('----离线后推送收银机订单打印无回执--' .date('Y-m-d H:i:s'). '--->' . $arr_json, 'cashier');
|
||||||
$arr_n[] = $arr;
|
$arr_n[] = $arr;
|
||||||
}
|
}
|
||||||
$redis->set($uid, json_encode($arr_n), self::REDIS_TIME);
|
Redis::set($uid, json_encode($arr_n), self::REDIS_TIME);
|
||||||
}
|
}
|
||||||
});
|
|
||||||
break;
|
break;
|
||||||
// 新增
|
// 新增
|
||||||
case 'add':
|
case 'add':
|
||||||
|
|||||||
Reference in New Issue
Block a user