Compare commits

...

5 Commits

Author SHA1 Message Date
9b5eb834cd 节目编辑时,翻页按钮浮动 2025-07-01 11:03:19 +08:00
37afb22641 稿件查询支持搜索 2025-07-01 11:02:20 +08:00
f779c07ebc 翻页变更 2025-07-01 00:46:47 +08:00
abc05ba3b5 mix asset support change bucket 2024-10-06 23:14:26 +08:00
70e24bb521 忽略composer.phar 2024-09-05 08:49:05 +08:00
8 changed files with 31 additions and 10 deletions

1
.gitignore vendored

@ -15,3 +15,4 @@ yarn-error.log
/.vscode
/public/mix-manifest.json
/composer.phar

@ -10,13 +10,24 @@ use Illuminate\Routing\Controller as BaseController;
class DanmakuQueryController extends BaseController
{
public function index()
public function index(Request $request)
{
$video_list = Videos::query()
$keyword = $request->get("keyword", "");
$query = Videos::query()
->withCount("danmakus", "bilibili_danmakus", "ixigua_danmakus", "douyin_danmakus", "programs")
->orderByDesc("created_at")
->paginate(10)->withQueryString();
->orderByDesc("created_at");
if ($keyword) {
$keyword_split = explode(" ", $keyword);
foreach ($keyword_split as $_keyword) {
$_keyword = trim($_keyword);
if (mb_strlen($_keyword) > 0) {
$query->where("title", "like", "%{$_keyword}%");
}
}
}
$video_list = $query->paginate(10)->withQueryString();
return view("danmaku.index", [
"keyword" => $keyword,
"video_list" => $video_list,
]);
}

@ -7,6 +7,11 @@
</head>
<body>
@include("common.header")
<form class="max-w xl:max-w-5xl lg:max-w-2xl md:max-w-lg mx-2 md:mx-auto form py-2" action="">
<label for="keyword">查找视频标题,空格隔开查找多个关键词</label>
<input class="border border-black" type="text" name="keyword" id="keyword" value="{{$keyword}}">
<input class="border border-black" type="submit">
</form>
@foreach($video_list as $video)
<div class="max-w xl:max-w-5xl lg:max-w-2xl md:max-w-lg mx-2 md:mx-auto px-2 md:px-4 py-4 bg-white border border-gray-200 rounded-lg shadow-md my-4 dark:bg-gray-800">
<div>
@ -52,7 +57,7 @@
</div>
</div>
@endforeach
<div class="max-w xl:max-w-5xl lg:max-w-2xl md:max-w-lg mx-2 md:mx-auto">
<div class="max-w xl:max-w-5xl lg:max-w-2xl md:max-w-lg mx-2 md:mx-auto sticky bottom-0">
{{$video_list->links()}}
</div>
@include("common.footer")

@ -36,7 +36,9 @@
@endforeach
</tbody>
</table>
<div class="max-w xl:max-w-5xl lg:max-w-2xl md:max-w-lg mx-2 md:mx-auto sticky bottom-0">
{{$danmakus->links()}}
</div>
@include("common.footer")
</body>
</html>

@ -37,7 +37,7 @@
</div>
</div>
@endforeach
<div class="max-w xl:max-w-5xl lg:max-w-2xl md:max-w-lg mx-2 md:mx-auto">
<div class="max-w xl:max-w-5xl lg:max-w-2xl md:max-w-lg mx-2 md:mx-auto sticky bottom-0">
{{$comments->links()}}
</div>
@include("common.footer")

@ -69,7 +69,9 @@
@endforeach
</tbody>
</table>
<div class="max-w xl:max-w-5xl lg:max-w-2xl md:max-w-lg mx-2 md:mx-auto sticky bottom-0">
{{$programs->links()}}
</div>
@include("common.footer")
</body>
</html>

@ -88,7 +88,7 @@
@endforeach
</tbody>
</table>
<div class="max-w xl:max-w-5xl lg:max-w-2xl md:max-w-lg mx-2 md:mx-auto">
<div class="max-w xl:max-w-5xl lg:max-w-2xl md:max-w-lg mx-2 md:mx-auto sticky bottom-0">
{{$programs->links()}}
</div>
@include("common.footer")

@ -8,7 +8,7 @@ if (mix.inProduction()) {
new S3PusherPlugin({
key: process.env.AWS_ACCESS_KEY_ID,
secret: process.env.AWS_SECRET_ACCESS_KEY,
bucket: "cdn",
bucket: process.env.MIX_BUCKET,
region: process.env.AWS_DEFAULT_REGION,
endpoint: process.env.AWS_ENDPOINT,
prefix: 'lubo',