find($id); if (!empty($logSave)) { if (empty($logSave['last_ratio_status'])) { $logSave['last_ratio'] = D('game')->where(array('id' => $logSave['game_id']))->getField('ratio'); $logSave['last_ratio'] = $logSave['last_ratio'] ?? 0; } $logSave['create_time'] = $logSave['update_time']; unset($logSave['id']); unset($logSave['update_time']); M('promote_game_ratio_log', 'tab_')->add($logSave); } } }