add-trans

This commit is contained in:
xiaomlove
2021-05-19 19:45:41 +08:00
parent ce05680219
commit 88207b9975
7 changed files with 33 additions and 2 deletions
+1 -1
View File
@@ -11,7 +11,7 @@ class CommentController extends Controller
/** /**
* Display a listing of the resource. * Display a listing of the resource.
* *
* @return \Illuminate\Http\Response * @return array
*/ */
public function index(Request $request) public function index(Request $request)
{ {
+3
View File
@@ -31,6 +31,9 @@ class ExamController extends Controller
{ {
$result = $this->repository->getList($request->all()); $result = $this->repository->getList($request->all());
$resource = ExamResource::collection($result); $resource = ExamResource::collection($result);
$resource->additional([
'page_title' => nexus_trans('exam.admin.list.page_title'),
]);
return $this->success($resource); return $this->success($resource);
} }
@@ -30,6 +30,9 @@ class ExamUserController extends Controller
{ {
$result = $this->repository->listUser($request->all()); $result = $this->repository->listUser($request->all());
$resource = ExamUserResource::collection($result); $resource = ExamUserResource::collection($result);
$resource->additional([
'page_title' => nexus_trans('exam-user.admin.list.page_title'),
]);
return $this->success($resource); return $this->success($resource);
} }
+7 -1
View File
@@ -1,5 +1,7 @@
<?php <?php
# IMPORTANT: Do not edit below unless you know what you are doing! # IMPORTANT: Do not edit below unless you know what you are doing!
use Illuminate\Support\Facades\DB;
if(!defined('IN_TRACKER')) if(!defined('IN_TRACKER'))
die('Hacking attempt!'); die('Hacking attempt!');
@@ -207,7 +209,11 @@ function delete_user(\Illuminate\Database\Eloquent\Builder $query, $reasonKey)
'reason' => nexus_trans($reasonKey, [], $user->locale), 'reason' => nexus_trans($reasonKey, [], $user->locale),
]; ];
} }
\App\Models\User::query()->whereIn('id', $uidArr)->delete(); $update = [
'enabled' => \App\Models\User::ENABLED_NO,
'modcomment' => DB::raw("concat_ws('\n', '[CLEANUP] $reasonKey', modcomment)"),
];
\App\Models\User::query()->whereIn('id', $uidArr)->update($update);
\App\Models\UserBanLog::query()->insert($userBanLogData); \App\Models\UserBanLog::query()->insert($userBanLogData);
do_log("delete user($reasonKey): " . implode(', ', $uidArr)); do_log("delete user($reasonKey): " . implode(', ', $uidArr));
return $uidArr; return $uidArr;
+9
View File
@@ -0,0 +1,9 @@
<?php
return [
'admin' => [
'list' => [
'page_title' => '考核用户列表'
]
]
];
+5
View File
@@ -19,4 +19,9 @@ return [
'checkout_not_pass_message_content' => '你在规定时间内(:begin ~ :end)未完成考核::exam_name,账号已被禁用。', 'checkout_not_pass_message_content' => '你在规定时间内(:begin ~ :end)未完成考核::exam_name,账号已被禁用。',
'ban_log_reason' => '未完成考核::exam_name(:begin ~ :end)', 'ban_log_reason' => '未完成考核::exam_name(:begin ~ :end)',
'ban_user_modcomment' => '未完成考核: :exam_name(:begin ~ :end), 被系统禁用.', 'ban_user_modcomment' => '未完成考核: :exam_name(:begin ~ :end), 被系统禁用.',
'admin' => [
'list' => [
'page_title' => '考核列表'
]
]
]; ];
+5
View File
@@ -2,4 +2,9 @@
return [ return [
'edit_ban_reason' => '被管理人员禁用', 'edit_ban_reason' => '被管理人员禁用',
'admin' => [
'list' => [
'page_title' => '用户列表'
]
]
]; ];