current state
This commit is contained in:
@@ -21,19 +21,19 @@ class InterviewController extends Controller
|
||||
$interviewId = (int) $request->input('interview_id');
|
||||
|
||||
try {
|
||||
DB::connection('legacy')->table('interviews_comment')->insert([
|
||||
DB::table('interviews_comment')->insert([
|
||||
'nid' => $interviewId,
|
||||
'author' => $_SESSION['web_login']['username'] ?? 'Anonymous',
|
||||
'datum' => DB::raw('CURRENT_TIMESTAMP'),
|
||||
'tekst' => $tekst,
|
||||
]);
|
||||
|
||||
$ar2 = DB::connection('legacy')->table('users')
|
||||
$ar2 = DB::table('users')
|
||||
->where('uname', $_SESSION['web_login']['username'])
|
||||
->first();
|
||||
|
||||
if (!empty($ar2->user_id)) {
|
||||
DB::connection('legacy')->table('users_statistics')
|
||||
DB::table('users_statistics')
|
||||
->where('user_id', $ar2->user_id)
|
||||
->increment('newscomment');
|
||||
}
|
||||
@@ -44,7 +44,7 @@ class InterviewController extends Controller
|
||||
}
|
||||
|
||||
try {
|
||||
$ar = DB::connection('legacy')->table('interviews')->where('id', $id)->first();
|
||||
$ar = DB::table('interviews')->where('id', $id)->first();
|
||||
} catch (\Throwable $e) {
|
||||
$ar = null;
|
||||
}
|
||||
@@ -54,7 +54,7 @@ class InterviewController extends Controller
|
||||
}
|
||||
|
||||
try {
|
||||
$artworks = DB::connection('legacy')->table('wallz')
|
||||
$artworks = DB::table('wallz')
|
||||
->where('uname', $ar->username)
|
||||
->inRandomOrder()
|
||||
->limit(2)
|
||||
@@ -64,7 +64,7 @@ class InterviewController extends Controller
|
||||
}
|
||||
|
||||
try {
|
||||
$comments = DB::connection('legacy')->table('interviews_comment as c')
|
||||
$comments = DB::table('interviews_comment as c')
|
||||
->leftJoin('users as u', 'u.uname', '=', 'c.author')
|
||||
->where('c.nid', $id)
|
||||
->select('c.*', 'u.user_id', 'u.user_type', 'u.signature', 'u.icon')
|
||||
@@ -79,7 +79,7 @@ class InterviewController extends Controller
|
||||
$postCounts = [];
|
||||
if (!empty($authors)) {
|
||||
try {
|
||||
$counts = DB::connection('legacy')->table('interviews_comment')
|
||||
$counts = DB::table('interviews_comment')
|
||||
->select('author', DB::raw('COUNT(*) as cnt'))
|
||||
->whereIn('author', $authors)
|
||||
->groupBy('author')
|
||||
|
||||
Reference in New Issue
Block a user