mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-24 20:17:24 +08:00
render searchbox relate icon css
This commit is contained in:
@@ -5,6 +5,7 @@ namespace App\Console\Commands;
|
|||||||
use App\Models\Exam;
|
use App\Models\Exam;
|
||||||
use App\Models\ExamProgress;
|
use App\Models\ExamProgress;
|
||||||
use App\Models\ExamUser;
|
use App\Models\ExamUser;
|
||||||
|
use App\Models\SearchBox;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use App\Repositories\ExamRepository;
|
use App\Repositories\ExamRepository;
|
||||||
use App\Repositories\SearchBoxRepository;
|
use App\Repositories\SearchBoxRepository;
|
||||||
@@ -66,10 +67,12 @@ class Test extends Command
|
|||||||
|
|
||||||
// $rep = new SearchBoxRepository();
|
// $rep = new SearchBoxRepository();
|
||||||
// $r = $rep->initSearchBoxField(4);
|
// $r = $rep->initSearchBoxField(4);
|
||||||
$imdb = new \Nexus\Imdb\Imdb();
|
// $imdb = new \Nexus\Imdb\Imdb();
|
||||||
$imdb_id = 5768840;
|
// $imdb_id = 5768840;
|
||||||
$r = $imdb->getMovie($imdb_id)->photo(true);
|
// $r = $imdb->getMovie($imdb_id)->photo(true);
|
||||||
dd($r);
|
|
||||||
|
$searchbox = (new SearchBoxRepository())->listIcon(4);
|
||||||
|
dd($searchbox);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,4 +8,9 @@ class Category extends NexusModel
|
|||||||
protected $table = 'categories';
|
protected $table = 'categories';
|
||||||
|
|
||||||
protected $fillable = ['mode', 'name', 'class_name', 'image', 'sort_index', 'icon_id'];
|
protected $fillable = ['mode', 'name', 'class_name', 'image', 'sort_index', 'icon_id'];
|
||||||
|
|
||||||
|
public function icon(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
|
{
|
||||||
|
return $this->belongsTo(Icon::class, 'icon_id');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
|
||||||
|
class Icon extends NexusModel
|
||||||
|
{
|
||||||
|
protected $table = 'caticons';
|
||||||
|
|
||||||
|
protected $fillable = ['name', 'folder', 'cssfile', 'multilang', 'secondicon', 'designer', 'comment'];
|
||||||
|
}
|
||||||
@@ -22,7 +22,4 @@ class SearchBox extends NexusModel
|
|||||||
return $this->hasMany(SearchBoxField::class, 'searchbox_id');
|
return $this->hasMany(SearchBoxField::class, 'searchbox_id');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Repositories;
|
namespace App\Repositories;
|
||||||
|
|
||||||
|
use App\Models\Icon;
|
||||||
use App\Models\NexusModel;
|
use App\Models\NexusModel;
|
||||||
use App\Models\SearchBox;
|
use App\Models\SearchBox;
|
||||||
use App\Models\SearchBoxField;
|
use App\Models\SearchBoxField;
|
||||||
@@ -80,5 +81,12 @@ class SearchBoxRepository extends BaseRepository
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function listIcon($id)
|
||||||
|
{
|
||||||
|
$searchBox = SearchBox::query()->findOrFail($id);
|
||||||
|
$iconIdArr = $searchBox->categories->pluck('icon_id')->unique();
|
||||||
|
return Icon::query()->find($iconIdArr);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2254,6 +2254,7 @@ function stdhead($title = "", $msgalert = true, $script = "", $place = "")
|
|||||||
global $tstart;
|
global $tstart;
|
||||||
global $Cache;
|
global $Cache;
|
||||||
global $Advertisement;
|
global $Advertisement;
|
||||||
|
global $browsecatmode;
|
||||||
|
|
||||||
$Cache->setLanguage($CURLANGDIR);
|
$Cache->setLanguage($CURLANGDIR);
|
||||||
|
|
||||||
@@ -2322,10 +2323,13 @@ $cssupdatedate=($cssupdatedate ? "?".htmlspecialchars($cssupdatedate) : "");
|
|||||||
<link rel="stylesheet" href="styles/curtain_imageresizer.css<?php echo $cssupdatedate?>" type="text/css" />
|
<link rel="stylesheet" href="styles/curtain_imageresizer.css<?php echo $cssupdatedate?>" type="text/css" />
|
||||||
<?php
|
<?php
|
||||||
if ($CURUSER){
|
if ($CURUSER){
|
||||||
$caticonrow = get_category_icon_row($CURUSER['caticon']);
|
// $caticonrow = get_category_icon_row($CURUSER['caticon']);
|
||||||
if($caticonrow['cssfile']){
|
// if($caticonrow['cssfile']){
|
||||||
|
|
||||||
|
$icons = (new \App\Repositories\SearchBoxRepository())->listIcon($browsecatmode);
|
||||||
|
foreach ($icons as $icon) {
|
||||||
?>
|
?>
|
||||||
<link rel="stylesheet" href="<?php echo htmlspecialchars($caticonrow['cssfile']).$cssupdatedate?>" type="text/css" />
|
<link rel="stylesheet" href="<?php echo htmlspecialchars(trim($icon['cssfile'], '/')).$cssupdatedate?>" type="text/css" />
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user