update
This commit is contained in:
@ -53,7 +53,11 @@ class Toutiao extends BaseSpider
|
||||
|
||||
$sitemapArray = [];
|
||||
|
||||
$query = AppNews::query()->select(['id', 'created_at'])->where('platform', $platform)->where('is_delete', 0)->get()->toArray();
|
||||
$query = AppNews::query()->select(['id', 'created_at'])
|
||||
->where('platform', $platform)
|
||||
->where('is_delete', 0)
|
||||
->orderBy('id', 'desc')
|
||||
->get()->toArray();
|
||||
foreach ($query as $item) {
|
||||
$date = date('Y-m-d', $item['created_at']);
|
||||
$sitemapArray[] = <<<EOF
|
||||
|
@ -36,6 +36,12 @@ class NewsService extends BaseService
|
||||
$query['column_tag'] = $columnTag->name ?? '';
|
||||
$query['column_tag_url'] = $columnTag->url ?? '';
|
||||
|
||||
if ($query['second_column']) {
|
||||
$columnTag = AppNewsSecondColumn::find($query['second_column']);
|
||||
$query['second_column_tag'] = $columnTag->name ?? '';
|
||||
$query['second_column_tag_url'] = $columnTag->url ?? '';
|
||||
}
|
||||
|
||||
// 相关文章
|
||||
$query['about'] = AppNews::formatQuery(['created_at'])
|
||||
->where('platform', $isRelation ? current(self::RELATION[$app_id]) : $app_id)
|
||||
|
Reference in New Issue
Block a user