You've already forked lubo_comment_query
错误提示及保留input
This commit is contained in:
@ -5,8 +5,10 @@ namespace App\Http\Controllers;
|
||||
use App\Models\Programs;
|
||||
use App\Models\ProgramVideos;
|
||||
use App\Models\VideoComments;
|
||||
use Illuminate\Database\QueryException;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Routing\Controller as BaseController;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class ProgramConstructController extends BaseController
|
||||
{
|
||||
@ -57,10 +59,8 @@ class ProgramConstructController extends BaseController
|
||||
$content = $request->post("content");
|
||||
$count = ProgramVideos::query()->where("video_bvid", "=", $bvid)->count();
|
||||
if ($count > 0) {
|
||||
return view("program.construct.batch_add", [
|
||||
"content" => $content,
|
||||
"bvid" => $bvid,
|
||||
"message" => "该BVID下已有{$count}个节目关联,请手动添加",
|
||||
return back()->withInput()->withErrors([
|
||||
"bvid" => "该BVID下已有{$count}个节目关联,请手动添加"
|
||||
]);
|
||||
}
|
||||
$regex = "/^p(?P<part>\d{1,2})[-# _:,)]+(?P<time>(0?1[::])?\d{1,3}[::]\d{1,2}) ?(?P<content>.+)$/ui";
|
||||
|
@ -103,7 +103,7 @@ class ProgramVideoConstructController extends BaseController
|
||||
|
||||
public function to_fix_created_at(Request $request, ProgramVideos $program_video) {
|
||||
if ($program_video->created_at === null) {
|
||||
return back()->withErrors([
|
||||
return back()->withInput()->withErrors([
|
||||
"id" => "没有开始时间,请先保存对应时间"
|
||||
]);
|
||||
}
|
||||
@ -118,7 +118,7 @@ class ProgramVideoConstructController extends BaseController
|
||||
"each_time" => ["required", "date_format:H:i:s"]
|
||||
]);
|
||||
if ($program_video->created_at === null) {
|
||||
return back()->withErrors([
|
||||
return back()->withInput()->withErrors([
|
||||
"id" => "没有开始时间,请先保存对应时间"
|
||||
]);
|
||||
}
|
||||
|
Reference in New Issue
Block a user