debug
This commit is contained in:
@@ -20,83 +20,6 @@ class SeoRenderer
|
||||
// $this->pool = SiteStyle::SEO_POOL[$poolId]['seo_phrase'] ?? [];
|
||||
}
|
||||
|
||||
/**
|
||||
* 只负责:选一条模板
|
||||
*/
|
||||
// public function getTemplate(string $field, string $strPage): string
|
||||
// {
|
||||
|
||||
// // 1️⃣ 取当前字段 + 页面类型的文案池
|
||||
// $phrases = loadSeoFile(
|
||||
// $this->cfg['pool_id'],
|
||||
// $strPage,
|
||||
// $field
|
||||
// );
|
||||
|
||||
// if (!$phrases) {
|
||||
// return '';
|
||||
// }
|
||||
|
||||
// // 2️⃣ 冻结的 slot
|
||||
// $slot = $this->cfg['phrase_pick'][$strPage][$field] ?? 0;
|
||||
|
||||
// // slot 是二维
|
||||
// if (isset($phrases[$slot]) && is_array($phrases[$slot])) {
|
||||
// $list = $phrases[$slot];
|
||||
// } else {
|
||||
// $list = $phrases;
|
||||
// }
|
||||
|
||||
// // 3️⃣ 稳定消费 index(不受扩容影响)
|
||||
// $len = $this->cfg['slot_len'][$strPage][$field] ?? count($list);
|
||||
// $len = max(1, min($len, count($list)));
|
||||
|
||||
// // $idx = abs(crc32(
|
||||
// // Request::pathinfo() ?: Request::host()
|
||||
// // )) % $len;
|
||||
// $idx = $this->cfg['phrase_idx'][$strPage][$field] ?? 0;
|
||||
// return $list[$idx] ?? '';
|
||||
|
||||
|
||||
// return $list[$idx] ?? '';
|
||||
// }
|
||||
// public function getTemplate(string $field, string $strPage): string
|
||||
// {
|
||||
// if (empty($this->cfg['pool_id'])) {
|
||||
// return '';
|
||||
// }
|
||||
|
||||
// // 1️⃣ 加载运行期文案池(不冻结)
|
||||
// $phrases = loadSeoFile(
|
||||
// $this->cfg['pool_id'],
|
||||
// $strPage,
|
||||
// $field
|
||||
// );
|
||||
|
||||
// if (!$phrases || !is_array($phrases)) {
|
||||
// return '';
|
||||
// }
|
||||
|
||||
// // 2️⃣ 冻结 slot
|
||||
// $slot = $this->cfg['phrase_pick'][$strPage][$field] ?? 0;
|
||||
|
||||
// if (isset($phrases[$slot]) && is_array($phrases[$slot])) {
|
||||
// $list = $phrases[$slot];
|
||||
// } else {
|
||||
// // 兜底:当成单 slot
|
||||
// $list = $phrases;
|
||||
// }
|
||||
|
||||
// if (!$list) {
|
||||
// return '';
|
||||
// }
|
||||
|
||||
// // 3️⃣ 冻结 idx(核心)
|
||||
// $idx = $this->cfg['phrase_idx'][$strPage][$field] ?? 0;
|
||||
|
||||
// return $list[$idx] ?? '';
|
||||
// }
|
||||
|
||||
|
||||
public function getTemplate(string $field, string $strPage): string
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user