cfn/app/Http/Controllers/ClientController.php
2025-02-24 12:07:54 +08:00

38 lines
933 B
PHP
Executable File

<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Models\ArticleList;
use App\Services\Time;
use voku\helper\AntiXSS;
use App\Models\Tags;
class ClientController extends Controller
{
public function singe($iCode)
{
$oAntiXss = new AntiXSS();
$iCode = $oAntiXss->xss_clean($iCode);
$aSinge = ArticleList::where("code", "=", $iCode)->first()->toArray();
$sTagsStr = $aSinge['tags'];
$sTagsStr = substr($sTagsStr, 1, -1);
$aTagsId = explode('][', $sTagsStr);
$aTagsMap = Tags::all()->toArray();
foreach ($aTagsId as $aTagsIdRow) {
$aTagsName[] = $aTagsMap[$aTagsIdRow-1];
}
return view("client/singe", [
"aSinge" => $aSinge,
'aTagNames' => $aTagsName,
'sMenu' => 'client',
]);
}
}