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

View File

@@ -11,7 +11,7 @@ class CommentController extends Controller
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
* @return array
*/
public function index(Request $request)
{

View File

@@ -31,6 +31,9 @@ class ExamController extends Controller
{
$result = $this->repository->getList($request->all());
$resource = ExamResource::collection($result);
$resource->additional([
'page_title' => nexus_trans('exam.admin.list.page_title'),
]);
return $this->success($resource);
}

View File

@@ -30,6 +30,9 @@ class ExamUserController extends Controller
{
$result = $this->repository->listUser($request->all());
$resource = ExamUserResource::collection($result);
$resource->additional([
'page_title' => nexus_trans('exam-user.admin.list.page_title'),
]);
return $this->success($resource);
}

View File

@@ -1,5 +1,7 @@
<?php
# IMPORTANT: Do not edit below unless you know what you are doing!
use Illuminate\Support\Facades\DB;
if(!defined('IN_TRACKER'))
die('Hacking attempt!');
@@ -207,7 +209,11 @@ function delete_user(\Illuminate\Database\Eloquent\Builder $query, $reasonKey)
'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);
do_log("delete user($reasonKey): " . implode(', ', $uidArr));
return $uidArr;

View File

@@ -0,0 +1,9 @@
<?php
return [
'admin' => [
'list' => [
'page_title' => '考核用户列表'
]
]
];

View File

@@ -19,4 +19,9 @@ return [
'checkout_not_pass_message_content' => '你在规定时间内(:begin ~ :end未完成考核:exam_name账号已被禁用。',
'ban_log_reason' => '未完成考核::exam_name(:begin ~ :end)',
'ban_user_modcomment' => '未完成考核: :exam_name(:begin ~ :end), 被系统禁用.',
'admin' => [
'list' => [
'page_title' => '考核列表'
]
]
];

View File

@@ -2,4 +2,9 @@
return [
'edit_ban_reason' => '被管理人员禁用',
'admin' => [
'list' => [
'page_title' => '用户列表'
]
]
];