isAjax()) { $param = request()->all(); $where = []; $model = new Videosupervision(); $project_id = isset($param['project_id']) ? $param['project_id'] : ''; if (!empty($project_id)) { $where[] = ['engineering_id', '=', $project_id]; } $list = $model->getPaginateList($where, ['*'], ['id' => 'asc'], [], $param['limit']); if($list['total']>0) { foreach ($list['data'] as $key => $item) { $whereao = [['id','=',$item['project_id']]]; $list['data'][$key]['projectname'] = ((new AdminOrg())->findOne($whereao,'name'))['data']['name']; $list['data'][$key]['engineering_type_name'] = (new BasicdataEngineering())->getInfoById($item['engineering_type']); $list['data'][$key]['user_name'] =(new AdminUser) ->where('id', $item['report_user_id']) ->first('nickname')['nickname']; } } return sparkSuccess(dataReturn(0, 'success', $list)); } return view('patrol/reportstatistics/index'); } /** * 重置巡检记录 * @param Request $request * @return \support\Response */ public function resetting(Request $request){ if ($request->isAjaxPost()) { $param = $request->post(); $model = new Videosupervision(); $model->updateById(['report_user_img'=>'','report_mobile'=>'','video_url'=>'','video_name'=>'','is_upload'=>1],$param['id']); return sparkSuccess(dataReturn(0, '重置成功')); } return sparkSuccess(dataReturn(0, 'error')); } }