|
@@ -25,6 +25,7 @@ class FirstPageController extends CatchController
|
|
$miniprogramType = $request->input('miniprogram_type');
|
|
$miniprogramType = $request->input('miniprogram_type');
|
|
$firstPageListType = $request->input('type');
|
|
$firstPageListType = $request->input('type');
|
|
$result = DB::table('first_pages')
|
|
$result = DB::table('first_pages')
|
|
|
|
+ ->where('is_enabled', 1)
|
|
->when($miniprogramType, function ($query, $miniprogramType){
|
|
->when($miniprogramType, function ($query, $miniprogramType){
|
|
return $query->where('miniprogram_type', $miniprogramType);
|
|
return $query->where('miniprogram_type', $miniprogramType);
|
|
})->when($firstPageListType, function ($query, $firstPageListType){
|
|
})->when($firstPageListType, function ($query, $firstPageListType){
|
|
@@ -122,5 +123,25 @@ class FirstPageController extends CatchController
|
|
|
|
|
|
return 'ok';
|
|
return 'ok';
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 删除
|
|
|
|
+ * @param Request $request
|
|
|
|
+ * @return string
|
|
|
|
+ * @throws \Illuminate\Validation\ValidationException
|
|
|
|
+ */
|
|
|
|
+ public function delete(Request $request) {
|
|
|
|
+ $this->validate($request, [
|
|
|
|
+ 'id' => 'required',
|
|
|
|
+ ]);
|
|
|
|
+ $now = date('Y-m-d H:i:s');
|
|
|
|
+ DB::table('first_pages')
|
|
|
|
+ ->where('id', $request->input('id'))
|
|
|
|
+ ->where('is_enabled', 1)
|
|
|
|
+ ->update(['is_enabled' => 0,
|
|
|
|
+ 'updated_at' => $now]);
|
|
|
|
+
|
|
|
|
+ return 'ok';
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|