inc('click_count') ->update(['last_click_at' => time()]); $data = LinksModel::find($id); $this->recordClickStat((int)$data->id, (int)$data->cid); } $this->view->assign('info', $data); $this->assignAds(); $this->assignSeo(); // 详情页 JSON-LD:WebPage if ($data) { $this->view->assign('jsonld', json_encode([ '@context' => 'https://schema.org', '@type' => 'WebPage', 'name' => (string)$data->title, 'description' => (string)($data->description ?: $data->title), 'url' => $this->request->domain() . '/haonav/site/' . $data->id . '.html', ], JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE)); } return $this->view->fetch('detail'); } }