This commit is contained in:
2025-11-05 14:17:47 +08:00
parent 1b8274d084
commit 1555d77ae9
3 changed files with 5 additions and 14 deletions

View File

@@ -16,12 +16,10 @@ use think\Model;
class Base extends Model
{
public static $db = null;
public static $client_id;
public static $shop_id;
public static $account;
public static $table_code;
public static $lock_name; // 锁单值
const RETRYCOUNT = 3;
const REDIS_TIME = 60 * 10; // redis 保存时间 10分钟
@@ -423,7 +421,6 @@ class Base extends Model
});
// 收银机打印回执
if(strstr($msg_id,'cashier_order') && $error) {
$db = self::$db;
$redis->get($msg_id, function ($result) use ($redis_name, $msg_id, $error, $db){
$result = json_decode($result, true);
$serviceLog = [
@@ -435,7 +432,7 @@ class Base extends Model
'fail_time' => date('Y-m-d H:i:s'),
'err_info' => $error,
];
$db->insert('mq_log')->cols($serviceLog)->query();
Db::name('mq_log')->insert($serviceLog);
});
}
$redis->del($msg_id);