Commit 15074f33 authored by shajiaiming's avatar shajiaiming

fix

parent b61b876f
...@@ -49,7 +49,7 @@ class NoticeController extends BaseController ...@@ -49,7 +49,7 @@ class NoticeController extends BaseController
} }
$status = Yii::$app->request->get('status', 0); $status = Yii::$app->request->get('status', 0);
$type = Yii::$app->request->get('type', 0); $type = Yii::$app->request->get('type', 0);
$query = Notice::find()->where(['platform_id' => $platform_id])->orderBy('create_time desc');; $query = Notice::find()->where(['platform_id' => $platform_id]);
if (false != $status) { if (false != $status) {
$query->andWhere(['status' => (int)$status]); $query->andWhere(['status' => (int)$status]);
...@@ -57,7 +57,7 @@ class NoticeController extends BaseController ...@@ -57,7 +57,7 @@ class NoticeController extends BaseController
if (false != $type) { if (false != $type) {
$query->andWhere(['type' => (int)$type]); $query->andWhere(['type' => (int)$type]);
} }
$model = $query->offset(($page - 1) * $size)->orderBy('create_time')->limit($size)->asArray()->all(); $model = $query->offset(($page - 1) * $size)->orderBy('create_time desc')->limit($size)->asArray()->all();
$countQuery = clone $query; $countQuery = clone $query;
$pages = new Pagination(['totalCount' => $countQuery->count(), 'pageSize' => $size]); $pages = new Pagination(['totalCount' => $countQuery->count(), 'pageSize' => $size]);
...@@ -103,7 +103,7 @@ class NoticeController extends BaseController ...@@ -103,7 +103,7 @@ class NoticeController extends BaseController
$code = -1; $code = -1;
goto doEnd; goto doEnd;
} }
if (User::AUTH_SUPER != $group && $platform_id != $model->platform_id) { if (User::AUTH_SUPER != $group && $platform_id != $model->platform_id){
$msg = '无权操作'; $msg = '无权操作';
$code = -1; $code = -1;
goto doEnd; goto doEnd;
...@@ -137,7 +137,7 @@ class NoticeController extends BaseController ...@@ -137,7 +137,7 @@ class NoticeController extends BaseController
} }
if (Yii::$app->request->isDelete) { if (Yii::$app->request->isDelete) {
$model = Notice::findOne($id); $model = Notice::findOne($id);
if (User::AUTH_SUPER != $group && $platform_id != $model->platform_id) { if (User::AUTH_SUPER != $group && $platform_id != $model->platform_id){
$msg = '无权删除'; $msg = '无权删除';
$code = -1; $code = -1;
goto doEnd; goto doEnd;
......
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