家谱(用户第 2 点,重写模板与 Kinship::tree): - 同代聚成「夫妻单元」(户):血亲当主位、配偶并排在其右,兄弟_姐妹按长幼(长子左) - 血亲可达性判「姻亲」:只走 parent/child 边从「我」可达者为本家血亲,妻子的父母 走不到 → 标「姻亲」并排到本代末尾(旧判据「上无父母且下无子女」对岳父母恒为假,是真 bug) - 父母括号连线:横杆盖住父母列到其子女各列,竖线落父母列中心、每子女列一道下线 - 称呼按长幼定死:姐夫/妹夫、嫂子/弟媳、大/小舅子、大/小姨子、大伯子/小叔子、 大姑子/小姑子、侄子/侄女、外甥/外甥女、堂/表 - 列宽地板 minmax(min-content,1fr):原 minmax(0,1fr) 在窄屏+户数多时把列压到卡片 (96px)以下 → 同代卡片互相重叠;.tnode 加 flex:0 0 auto 防被 flex 压扁 观影(用户第 3~5 点): - 顶栏删「影院」入口(影院是观影模块的子功能);观影列表右侧加「⚙ 设置」下拉, 内含 影院管理 / 高级搜索 / 统计 / 年度报告(后三者从 MovieLog 迁入, app/MovieStats.php + 三个只读路由,MySQL 方言;图表全用纯 CSS,不引 CDN) - 评价区删除「我」的长条徽标(被 flex column stretch 拉成整行宽的丑色带) - 观影人弹窗列表与已选 chips 带头像;syncChips 点名取 .att-name/.att-av (旧写法取「第一个 span」,v11 起那是隐藏占位,chip 上会没名字) 验证:e2e 432/0、桌面几何 268/0、移动几何 464/0、交互几何 97/0、 静态空跑 199/0、反向验证 v11 十条 10抓/0漏。本轮无 DB 变更(Schema 仍 v10)。 移动几何抓出两个真溢出并已修:高级搜索页 select 长选项撑破 .field、 原生 date 输入撑破 .date-range(360/375px)。
107 lines
4.4 KiB
PHP
107 lines
4.4 KiB
PHP
<?php
|
|
/**
|
|
* 高级搜索(v11,从 MovieLog search.php 迁入)。
|
|
*
|
|
* 与观影列表页顶部那个「一个关键词搜所有字段」的搜索栏不同:这里是**组合条件**——
|
|
* 片名 / 影院 / 观影人 / 日期范围 可以任意叠加,且观影人、影院是从下拉里点名选。
|
|
* 一个条件都不给时不查询,页面提示「先设置条件」(否则条件全空 = 全表,看着像卡了)。
|
|
*/
|
|
?>
|
|
<div class="page-head">
|
|
<h1>高级搜索</h1>
|
|
<span class="sub">组合多个条件精确查找</span>
|
|
<div class="actions">
|
|
<a class="btn btn-ghost btn-sm" href="<?= e(url('movies')) ?>">返回观影</a>
|
|
</div>
|
|
</div>
|
|
|
|
<form method="get" action="index.php" class="card card-pad adv-form">
|
|
<input type="hidden" name="r" value="movies/search">
|
|
<div class="form-grid">
|
|
<div class="field">
|
|
<label for="title">片名</label>
|
|
<input class="input" id="title" name="title" value="<?= e($p['title']) ?>" placeholder="输入片名的一部分即可">
|
|
</div>
|
|
<div class="field">
|
|
<label for="cinema_id">影院</label>
|
|
<select class="select" id="cinema_id" name="cinema_id">
|
|
<option value="0">全部影院</option>
|
|
<?php foreach ($cinemas as $c): ?>
|
|
<option value="<?= (int)$c['id'] ?>" <?= (int)$p['cinema_id'] === (int)$c['id'] ? 'selected' : '' ?>>
|
|
<?= e(trim(((string)($c['place'] ?? '') !== '' ? $c['place'] . ' · ' : '') . $c['name'])) ?>
|
|
</option>
|
|
<?php endforeach; ?>
|
|
</select>
|
|
</div>
|
|
<div class="field">
|
|
<label for="person_id">观影人</label>
|
|
<select class="select" id="person_id" name="person_id">
|
|
<option value="0">全部观影人</option>
|
|
<?php foreach ($persons as $pp): ?>
|
|
<option value="<?= (int)$pp['id'] ?>" <?= (int)$p['person_id'] === (int)$pp['id'] ? 'selected' : '' ?>>
|
|
<?= e((string)$pp['name']) ?>
|
|
</option>
|
|
<?php endforeach; ?>
|
|
</select>
|
|
</div>
|
|
<div class="field">
|
|
<label>日期范围</label>
|
|
<div class="date-range">
|
|
<input class="input" type="date" name="date_from" value="<?= e($p['date_from']) ?>">
|
|
<span class="to">至</span>
|
|
<input class="input" type="date" name="date_to" value="<?= e($p['date_to']) ?>">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="btn-row">
|
|
<button type="submit" class="btn">搜索</button>
|
|
<a class="btn btn-ghost" href="<?= e(url('movies/search')) ?>">清空条件</a>
|
|
</div>
|
|
</form>
|
|
|
|
<?php if (!$hasCond): ?>
|
|
<div class="card card-pad empty">
|
|
<b>先设置一个条件</b>
|
|
填上片名、挑一家影院、指定某个人,或者框一段日期,再点「搜索」。
|
|
</div>
|
|
<?php else: ?>
|
|
<div class="results-head">
|
|
<h3>搜索结果</h3>
|
|
<span class="sub">共 <?= count($rows) ?> 部</span>
|
|
</div>
|
|
<?php if (!$rows): ?>
|
|
<div class="card card-pad empty">
|
|
<b>没有找到符合条件的电影</b>
|
|
放宽一点条件再试。
|
|
</div>
|
|
<?php else: ?>
|
|
<div class="waterfall">
|
|
<?php foreach ($rows as $mv): ?>
|
|
<a class="movie-card" href="<?= e(url('movies/show', ['id' => (int)$mv['id']])) ?>">
|
|
<span class="card-image">
|
|
<?php if (!empty($mv['poster_key'])): ?>
|
|
<img src="<?= e(media_url($mv['poster_key'])) ?>" alt="<?= e($mv['title']) ?>" loading="lazy">
|
|
<?php else: ?>
|
|
<span class="placeholder-poster">
|
|
<span class="ph-icon" aria-hidden="true">影</span>
|
|
<span class="placeholder-title"><?= e($mv['title']) ?></span>
|
|
</span>
|
|
<?php endif; ?>
|
|
</span>
|
|
<span class="card-body">
|
|
<span class="card-title"><?= e($mv['title']) ?></span>
|
|
<span class="card-meta">
|
|
<span>📅 <?= e(\App\Movie::formatWatch($mv['starts_at'], $mv['ends_at'] ?? null)) ?></span>
|
|
<?php if (!empty($mv['cinema_name'])): ?>
|
|
<span style="color: <?= e((string)($mv['cinema_color'] ?: '#888888')) ?>">🏛️ <?= e($mv['cinema_name']) ?></span>
|
|
<?php endif; ?>
|
|
</span>
|
|
<?php if (!empty($mv['attendee_names'])): ?>
|
|
<span class="card-viewers"><span class="viewer-tag">👥 <?= e($mv['attendee_names']) ?></span></span>
|
|
<?php endif; ?>
|
|
</span>
|
|
</a>
|
|
<?php endforeach; ?>
|
|
</div>
|
|
<?php endif; ?>
|
|
<?php endif; ?>
|