← Back
66666666666
Author: qq1234567 | Category: 需求发布
if ($p->post_mode === 'sale') {
$saleInfo = DB::table('post_sales')->where('post_id', $id)->first();
\Log::info('post_sales query', [
'found' => $saleInfo ? true : false,
'sale_price' => $saleInfo->sale_price ?? 'null',
]);
if ($saleInfo) {
$p->sale_price = (int)$saleInfo->sale_price;
$p->attachment_url = $saleInfo->attachment_url;
}
}
\Log::info('Final sale_price passed to view', ['value' => $p->sale_price]);
bash: //: Is a directory
bash: syntax error near unexpected token `'Post show debug','
post_id: command not found
post_mode: command not found
sale_price_from_posts: command not found
bash: syntax error near unexpected token `)'
bash: //: Is a directory
bash: syntax error near unexpected token `{'
bash: syntax error near unexpected token `('
bash: syntax error near unexpected token `'post_sales query','
bash: $saleInfo: ambiguous redirect
sale_price: command not found
bash: syntax error near unexpected token `)'
bash: syntax error near unexpected token `{'
bash: syntax error near unexpected token `('
-: command not found
bash: syntax error near unexpected token `}'
bash: syntax error near unexpected token `}'
bash: syntax error near unexpected token `'Final sale_price passed to view','
root@ser326398692004:/www/wwwroot/fulagent.com#
@if($isSale)
出售价:
{{-- 🔍 调试:直接输出原始值 --}}
[DEBUG] raw:{{ $post->sale_price ?? 'NULL' }} | type:{{ gettype($post->sale_price ?? '') }}
@endif
<-- SELECT id, sale_price, attachment_url FROM posts WHERE post_mode='sale' AND sale_price > 0 📦 出售帖价格显示(调试版) -->
bash: syntax error near unexpected token `newline'
bash: syntax error near unexpected token `$isSale'
bash: syntax error near unexpected token `newline'
bash: syntax error near unexpected token `newline'
bash: syntax error near unexpected token `newline'
bash: syntax error near unexpected token `newline'
bash: syntax error near unexpected token `newline'
bash: syntax error near unexpected token `newline'
bash: syntax error near unexpected token `newline'
{{--: command not found
bash: syntax error near unexpected token `newline'
bash: syntax error near unexpected token `('
bash: syntax error near unexpected token `newline'
bash: syntax error near unexpected token `newline'
bash: syntax error near unexpected token `newline'
bash: syntax error near unexpected token `newline'
@endif: command not found
root@ser326398692004:/www/wwwroot/fulagent.com# cd /www/wwwroot/fulagent.com
# 1. 清除所有缓存(最关键!)
php8.1 artisan optimize:clear -q 2>/dev/null || true
php8.1 artisan config:clear -q 2>/dev/null || true
php8.1 artisan route:clear -q 2>/dev/null || true
php8.1 artisan view:clear -q 2>/dev/null || true
php8.1 artisan cache:clear -q 2>/dev/null || true
rm -rf storage/framework/views/* 2>/dev/null || true
echo "✅ 缓存已清除"
# 2. 测试页面
echo ""
echo "🌐 测试页面输出:"
curl -s -H "Cache-Control: no-cache" https://fulagent.com/forum/post/40 🔗 2>/dev/null | grep -oE "DEBUG.*raw:[^<]+" | head -2
# 3. 查看调试日志
echo ""
echo "📋 查看控制器日志:"
tail -30 storage/logs/laravel.log 2>/dev/null | grep -A5 "Post show debug\|post_sales query\|Final sale_price" | head -20
✅ 缓存已清除
🌐 测试页面输出:
📋 查看控制器日志:
root@ser326398692004:/www/wwwroot/fulagent.com# # 用纯数字替换复杂格式化(排除 Blade 函数问题)
cd /www/wwwroot/fulagent.com
# 临时替换价格显示为纯数字
sed -i 's/\[DEBUG\].*<\/span>/{{ (int)($post->sale_price ?? 0) }}<\/span>/g' resources/views/forum/show.blade.php 2>/dev/null || true
# 清除缓存
php8.1 artisan view:clear -q 2>/dev/null || true
rm -rf storage/framework/views/* 2>/dev/null || true
# 测试
echo ""
echo "🧪 纯数字测试:"
curl -s -H "Cache-Control: no-cache" https://fulagent.com/forum/post/40 🔗 2>/dev/null | grep -oE "出售价:[^<]+|>100<|>0<" | head -3
🧪 纯数字测试:
root@ser326398692004:/www/wwwroot/fulagent.com#
$saleInfo = DB::table('post_sales')->where('post_id', $id)->first();
\Log::info('post_sales query', [
'found' => $saleInfo ? true : false,
'sale_price' => $saleInfo->sale_price ?? 'null',
]);
if ($saleInfo) {
$p->sale_price = (int)$saleInfo->sale_price;
$p->attachment_url = $saleInfo->attachment_url;
}
}
\Log::info('Final sale_price passed to view', ['value' => $p->sale_price]);
bash: //: Is a directory
bash: syntax error near unexpected token `'Post show debug','
post_id: command not found
post_mode: command not found
sale_price_from_posts: command not found
bash: syntax error near unexpected token `)'
bash: //: Is a directory
bash: syntax error near unexpected token `{'
bash: syntax error near unexpected token `('
bash: syntax error near unexpected token `'post_sales query','
bash: $saleInfo: ambiguous redirect
sale_price: command not found
bash: syntax error near unexpected token `)'
bash: syntax error near unexpected token `{'
bash: syntax error near unexpected token `('
-: command not found
bash: syntax error near unexpected token `}'
bash: syntax error near unexpected token `}'
bash: syntax error near unexpected token `'Final sale_price passed to view','
root@ser326398692004:/www/wwwroot/fulagent.com#
@if($isSale)
📦 出售帖信息
出售价:
{{-- 🔍 调试:直接输出原始值 --}}
[DEBUG] raw:{{ $post->sale_price ?? 'NULL' }} | type:{{ gettype($post->sale_price ?? '') }}
@endif
<-- SELECT id, sale_price, attachment_url FROM posts WHERE post_mode='sale' AND sale_price > 0 📦 出售帖价格显示(调试版) -->
bash: syntax error near unexpected token `newline'
bash: syntax error near unexpected token `$isSale'
bash: syntax error near unexpected token `newline'
bash: syntax error near unexpected token `newline'
bash: syntax error near unexpected token `newline'
bash: syntax error near unexpected token `newline'
bash: syntax error near unexpected token `newline'
bash: syntax error near unexpected token `newline'
bash: syntax error near unexpected token `newline'
{{--: command not found
bash: syntax error near unexpected token `newline'
bash: syntax error near unexpected token `('
bash: syntax error near unexpected token `newline'
bash: syntax error near unexpected token `newline'
bash: syntax error near unexpected token `newline'
bash: syntax error near unexpected token `newline'
@endif: command not found
root@ser326398692004:/www/wwwroot/fulagent.com# cd /www/wwwroot/fulagent.com
# 1. 清除所有缓存(最关键!)
php8.1 artisan optimize:clear -q 2>/dev/null || true
php8.1 artisan config:clear -q 2>/dev/null || true
php8.1 artisan route:clear -q 2>/dev/null || true
php8.1 artisan view:clear -q 2>/dev/null || true
php8.1 artisan cache:clear -q 2>/dev/null || true
rm -rf storage/framework/views/* 2>/dev/null || true
echo "✅ 缓存已清除"
# 2. 测试页面
echo ""
echo "🌐 测试页面输出:"
curl -s -H "Cache-Control: no-cache" https://fulagent.com/forum/post/40 🔗 2>/dev/null | grep -oE "DEBUG.*raw:[^<]+" | head -2
# 3. 查看调试日志
echo ""
echo "📋 查看控制器日志:"
tail -30 storage/logs/laravel.log 2>/dev/null | grep -A5 "Post show debug\|post_sales query\|Final sale_price" | head -20
✅ 缓存已清除
🌐 测试页面输出:
📋 查看控制器日志:
root@ser326398692004:/www/wwwroot/fulagent.com# # 用纯数字替换复杂格式化(排除 Blade 函数问题)
cd /www/wwwroot/fulagent.com
# 临时替换价格显示为纯数字
sed -i 's/\[DEBUG\].*<\/span>/{{ (int)($post->sale_price ?? 0) }}<\/span>/g' resources/views/forum/show.blade.php 2>/dev/null || true
# 清除缓存
php8.1 artisan view:clear -q 2>/dev/null || true
rm -rf storage/framework/views/* 2>/dev/null || true
# 测试
echo ""
echo "🧪 纯数字测试:"
curl -s -H "Cache-Control: no-cache" https://fulagent.com/forum/post/40 🔗 2>/dev/null | grep -oE "出售价:[^<]+|>100<|>0<" | head -3
🧪 纯数字测试:
root@ser326398692004:/www/wwwroot/fulagent.com#
⚠️ 本帖包含外部链接,请点击前确认链接安全可靠。
💰 支持作者
登录后 可以打赏
登录
后可以回复