ピンとロックを更新

このコミットが含まれているのは:
テクニカル諏訪子 2019-02-01 18:19:04 +09:00
コミット 6fe496c8ec
1個のファイルの変更20行の追加6行の削除

ファイルの表示

@ -947,11 +947,18 @@ class BoardController extends Controller {
$valid = $this->objAuth->getPermissions($request->username, $request->password);
if ($valid['for_locky'] == 1) {
return DB::table('for_threads')
$s = DB::table('for_threads')
->select('lock')
->where('id', $request->id)
->first();
DB::table('for_threads')
->where('id', $request->id)
->update([
'lock' => 1
]);
'lock' => ($s->lock == 0 ? 1 : 0)
]);
return ($s->lock == 0 ? 1 : 0);
}
else {
return 'Permission denied.';
@ -1170,11 +1177,18 @@ class BoardController extends Controller {
$valid = $this->objAuth->getPermissions($request->username, $request->password);
if ($valid['for_sticky'] == 1) {
return DB::table('for_threads')
$s = DB::table('for_threads')
->select('sticky')
->where('id', $request->id)
->first();
DB::table('for_threads')
->where('id', $request->id)
->update([
'sticky' => 1
]);
'sticky' => ($s->sticky == 0 ? 1 : 0)
]);
return ($s->sticky == 0 ? 1 : 0);
}
else {
return 'Permission denied.';