|
@@ -43,7 +43,25 @@ class WechatCheckController extends CatchController
|
|
|
* 修改
|
|
|
* @param Request $request
|
|
|
*/
|
|
|
- public function update(Request $request) {}
|
|
|
+ public function update(Request $request) {
|
|
|
+ $this->validate($request, [
|
|
|
+ 'id'=>'required',
|
|
|
+ 'producer' => 'required|string|max:256',
|
|
|
+ 'playwright' => 'required|string|max:256',
|
|
|
+ 'production_license_img' => 'required|url',
|
|
|
+ 'authorized_img' => 'required|url',
|
|
|
+ 'registration_number' => 'required'
|
|
|
+ ]);
|
|
|
+
|
|
|
+ $data = $request->all();
|
|
|
+ $data['updated_at'] = date('Y-m-d H:i:s');
|
|
|
+ unset($data['id']);
|
|
|
+ DB::table('video_wechat_check')
|
|
|
+ ->where('id', $request->input('id'))
|
|
|
+ ->where('is_enabled', 1)
|
|
|
+ ->update($data);
|
|
|
+ return 'ok';
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 删除
|
|
@@ -70,12 +88,12 @@ class WechatCheckController extends CatchController
|
|
|
$videoId = $request->input('video_id');
|
|
|
$producer = $request->input('producer');
|
|
|
$playwright = $request->input('playwright');
|
|
|
- $status = $request->input('status',0);
|
|
|
+ $status = $request->input('status',[0]);
|
|
|
|
|
|
return DB::table('video_wechat_check as check')
|
|
|
->join('videos', 'videos.id', 'check.video_id')
|
|
|
+ ->whereIn('check.status', $status)
|
|
|
->where([
|
|
|
- 'check.status' => $status,
|
|
|
'check.is_enabled' => 1,
|
|
|
])->when($videoId, function ($query, $videoId) {
|
|
|
return $query->where('check.video_id', $videoId);
|
|
@@ -88,7 +106,7 @@ class WechatCheckController extends CatchController
|
|
|
'check.playwright', 'check.production_license_img', 'check.authorized_img', 'check.apply_at',
|
|
|
'check.check_at', 'check.check_reason', 'check.registration_number')
|
|
|
->orderBy('check.id','desc')
|
|
|
- ->paginate($request->input('limit', 10));
|
|
|
+ ->paginate($request->input('limit', 20));
|
|
|
|
|
|
}
|
|
|
|