31 lines
780 B
PHP
Executable File
31 lines
780 B
PHP
Executable File
<?php
|
||
|
||
declare(strict_types=1);
|
||
|
||
namespace App\Services\Ship;
|
||
|
||
use App\Models\Ship;
|
||
|
||
final class ServiceShipHtml
|
||
{
|
||
|
||
public static function byShipCode($aShipCode)
|
||
{
|
||
|
||
$sJctj = "";
|
||
foreach ($aShipCode as $sShipCode) {
|
||
$oShip = Ship::where("code", $sShipCode)->first();
|
||
$sJctj .= "<h2>机场推荐 - {$oShip->name}:</h2>\n\n";
|
||
$aShipGood = json_decode($oShip->good, true);
|
||
$sShipGood = implode("\n\n", $aShipGood);
|
||
$sJctj .= $sShipGood;
|
||
$sJctj .= "\n\n";
|
||
$sJctj .= "<b><a target='__blank' style='color:blue;' href='https://{$oShip->www}'>👉 点击进入机场官网:{$oShip->name}。</a></b>";
|
||
}
|
||
|
||
return $sJctj;
|
||
|
||
}
|
||
|
||
}
|