update
This commit is contained in:
@ -136,8 +136,17 @@ class NewsService extends BaseService
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$articles['articles'] = $res;
|
$articles['articles'] = $res;// 随机推荐
|
||||||
|
$articles['about'] = AppNews::formatQuery(['created_at'])
|
||||||
|
->where('platform', $id)
|
||||||
|
->where('is_delete', 0)
|
||||||
|
->select(['title', 'id'])
|
||||||
|
->limit(10)
|
||||||
|
->orderBy(Db::raw('RAND()'))
|
||||||
|
->get()
|
||||||
|
->toArray();
|
||||||
$total = current($total)?->total ?? 0;
|
$total = current($total)?->total ?? 0;
|
||||||
|
var_dump('pageCOunt',$total / $limit);
|
||||||
return $this->getResponse()->setExtra('total', ceil($total / $limit))->setData($articles)->setCode(0)->send();
|
return $this->getResponse()->setExtra('total', ceil($total / $limit))->setData($articles)->setCode(0)->send();
|
||||||
}
|
}
|
||||||
}
|
}
|
Reference in New Issue
Block a user