fix: Db::find() 全量查询 + fallback 到 params[data];同时加调试日志
parent
0a2fd29d7c
commit
5dc9a98420
|
|
@ -57,9 +57,13 @@ class AdminGoodsSaveHandle
|
|||
$goodsId = $params['goods_id'] ?? 0;
|
||||
|
||||
if ($goodsId > 0 && ($data['item_type'] ?? '') === 'ticket') {
|
||||
// 直接从数据库读 vr_goods_config(避免 $params['data'] 值拷贝的引用链问题)
|
||||
$goodsRow = Db::name('Goods')->field('vr_goods_config')->find($goodsId);
|
||||
$rawConfig = $goodsRow['vr_goods_config'] ?? '';
|
||||
// 直接从数据库读 vr_goods_config(全量查询,不加 field 限制,避免 ThinkPHP 软删除过滤导致查不到)
|
||||
$goodsRow = Db::name('Goods')->find($goodsId);
|
||||
$rawConfig = is_array($goodsRow) ? ($goodsRow['vr_goods_config'] ?? '') : '';
|
||||
// 如果 DB 里没有( goodsRow 为空或 vr_goods_config 字段为空),fallback 到 params[data]
|
||||
if (empty($rawConfig)) {
|
||||
$rawConfig = $data['vr_goods_config'] ?? '';
|
||||
}
|
||||
|
||||
// DEBUG: 记录关键值
|
||||
$debugPath = defined('RUNTIME_PATH') ? RUNTIME_PATH . 'vr_debug.log' : '/tmp/vr_debug.log';
|
||||
|
|
|
|||
Loading…
Reference in New Issue