Commit df373183 authored by shajiaiming's avatar shajiaiming

Merge branch 'feature/optimize' into 'master'

Feature/optimize See merge request !264
parents 6c299723 df11f82f
......@@ -44,8 +44,9 @@ class NoticeController extends BaseController
$size = \Yii::$app->request->get('size', 10);
$query = Notice::find()
->select('id, title, content, author, type, is_top, create_time')
->select('id, title, content, author, type, is_top, create_time, update_time')
->where(['status' => Notice::STATUS_ON, 'platform_id' => (int)$platform_id])
->groupBy('title')
->orderBy('create_time desc');
if (false != $type) {
......
......@@ -130,23 +130,23 @@ class FlashController extends BaseController
$code = 0;
$data = null;
$group = Yii::$app->request->getGroup();
$platform_id = Yii::$app->request->post('platform_id', 0);
if (User::AUTH_SUPER !== $group && $platform_id != Yii::$app->request->getPlatformId()) {
$msg = '暂无权限';
$code = -1;
goto doEnd;
}
if (!isset(Yii::$app->params['trusteeship']['node_' . $platform_id])) {
$msg = '此钱包节点尚未开通';
$code = -1;
goto doEnd;
}
$node_params = Yii::$app->params['trusteeship']['node_' . $platform_id];
$result = Yii::$app->request->post();
$time = time();
if (Yii::$app->request->isPost) {
$platform_id = Yii::$app->request->post('platform_id', 0);
if (User::AUTH_SUPER !== $group && $platform_id != Yii::$app->request->getPlatformId()) {
$msg = '暂无权限';
$code = -1;
goto doEnd;
}
if (!isset(Yii::$app->params['trusteeship']['node_' . $platform_id])) {
$msg = '此钱包节点尚未开通';
$code = -1;
goto doEnd;
}
$node_params = Yii::$app->params['trusteeship']['node_' . $platform_id];
$params = [
'type' => $result['type'] ?? '',
'from' => $result['from'] ?? '',
......@@ -183,6 +183,20 @@ class FlashController extends BaseController
}
if (Yii::$app->request->isPut) {
$platform_id = Yii::$app->request->post('platform_id', 0);
if (User::AUTH_SUPER !== $group && $platform_id != Yii::$app->request->getPlatformId()) {
$msg = '暂无权限';
$code = -1;
goto doEnd;
}
if (!isset(Yii::$app->params['trusteeship']['node_' . $platform_id])) {
$msg = '此钱包节点尚未开通';
$code = -1;
goto doEnd;
}
$node_params = Yii::$app->params['trusteeship']['node_' . $platform_id];
$params = [
'id' => $result['id'] ?? '',
'from' => $result['from'] ?? '',
......@@ -219,8 +233,22 @@ class FlashController extends BaseController
}
if (Yii::$app->request->isDelete) {
$platform_id = Yii::$app->request->get('platform_id', 0);
if (User::AUTH_SUPER !== $group && $platform_id != Yii::$app->request->getPlatformId()) {
$msg = '暂无权限';
$code = -1;
goto doEnd;
}
if (!isset(Yii::$app->params['trusteeship']['node_' . $platform_id])) {
$msg = '此钱包节点尚未开通';
$code = -1;
goto doEnd;
}
$node_params = Yii::$app->params['trusteeship']['node_' . $platform_id];
$params = [
'id' => Yii::$app->request->post('id', '')
'id' => Yii::$app->request->get('id', '')
];
$time = time();
$appKey = isset($node_params['appKey']) ? $node_params['appKey'] : null;
......
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