Commit b35924a8 authored by shajiaiming's avatar shajiaiming

公告分页

parent 03f2914d
......@@ -71,6 +71,7 @@ class NoticeController extends BaseController
{
$id = Yii::$app->request->get('id', '');
$page = Yii::$app->request->get('page', 1);
$size = Yii::$app->request->get('size', 10);
$exchange = Yii::$app->request->get('exchange', 'zhaobi');
$exchange_arr = ['huobi', 'binance', 'okex', 'zhaobi'];
if (!in_array($exchange, $exchange_arr)) {
......@@ -81,7 +82,8 @@ class NoticeController extends BaseController
}
$params = [
'id' => $id,
'page' => $page
'page' => $page,
'size' => $size
];
$builder = ExchangeBuilderFactory::create($exchange);
$result = $builder->getNotice($params);
......
......@@ -62,7 +62,7 @@ class ZhaobiBuilder extends FactoryService
return ['code' => $this->code, 'notice' => $res['data'], 'msg' => $res['message']];
}
}
$api = $this->base_url . '/api/data/noticelist?page=' . $params['page'];
$api = $this->base_url . '/api/data/noticelist?page=' . $params['page'] . '&size=' . $params['size'];
$res = $curl->get($api, false);
if (isset($res['message']) && 'OK' == $res['message']) {
$this->code = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment