Commit 22c32f4e authored by shajiaiming's avatar shajiaiming

fix

parent 4e222832
......@@ -42,15 +42,15 @@ class NoticeController extends BaseController
if (Yii::$app->request->isGet) {
$status = Yii::$app->request->get('status', 0);
$type = Yii::$app->request->get('type', 0);
$query = Notice::find()->select('id, title, type, create_at')->where(['platform_id' => $platform_id])->asArray();
$query = Notice::find()->select('id, title, type, create_time')->where(['platform_id' => $platform_id])->asArray();
if (false != $status) {
$query->andWhere(['status' => $status]);
$query->andWhere(['status' => (int)$status]);
}
if (false != $type) {
$query->andWhere(['type' => $type]);
$query->andWhere(['type' => (int)$type]);
}
$model = $query->offset(($page - 1) * $size)->orderBy('create_at')->limit($size)->asArray()->all();
$model = $query->offset(($page - 1) * $size)->orderBy('create_time')->limit($size)->asArray()->all();
$countQuery = clone $query;
$pages = new Pagination(['totalCount' => $countQuery->count(), 'pageSize' => $size]);
......
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