Ejemplo n.º 1
0
 public function getLocation()
 {
     $nhserver = Nhserver::find($this->location_id);
     if ($nhserver) {
         return $nhserver->province;
     }
     return '';
 }
Ejemplo n.º 2
0
 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function update(Request $request)
 {
     //
     $input = $request->all();
     $messages = array('host.required' => '请填写服务器!', 'port.required' => '请填写端口!', 'province.required' => '请填写所在省!');
     $validator = $this->getValidationFactory()->make($input, ['host' => 'required', 'port' => 'required', 'province' => 'required'], $messages);
     if ($validator->fails()) {
         $messages = $validator->messages();
         return $messages;
     }
     $id = $request->id;
     $nhserver = Nhserver::find($id);
     $nhserver->host = $request->host;
     $nhserver->port = $request->port;
     $nhserver->province = $request->province;
     $nhserver->save();
     echo json_encode("1");
 }
Ejemplo n.º 3
0
 public function export(Request $request)
 {
     $tag = $request->tag;
     $ids = $request->session()->get($tag . '.tids', array());
     //        if(count($ids) == 0){
     //            return json_encode(array('msg'=>'请选择要导出的数据'));
     //        }
     $heads = ['location', 'time_log', 'WFormId', 'Identifier', 'WFormSetTime', 'ReplyDue', 'IsChecked', 'ArriveDue', 'WFormContent', 'OrgName', 'InstallAddress', 'ModelId', 'BrandId', 'Engineer', 'RepairCreateTime', 'RespTime', 'ArrivalTime', 'RepairformSts', 'MaintianComTel', 'GivenArrivalTime', 'Mobile', 'ebs_id'];
     $cellData[] = $heads;
     foreach ($ids as $id) {
         $ticket = Ticket::find($id);
         $location = '';
         if ($ticket->location_id != 0) {
             $nhserver = Nhserver::find($ticket->location_id);
             if ($nhserver) {
                 $location = $nhserver->province;
             }
         }
         $cell = [$location, $ticket->time_log, $ticket->WFormId, $ticket->Identifier, $ticket->WFormSetTime, $ticket->ReplyDue, $ticket->IsChecked, $ticket->ArriveDue, $ticket->WFormContent, $ticket->OrgName, $ticket->InstallAddress, $ticket->ModelId, $ticket->BrandId, $ticket->Engineer, $ticket->RepairCreateTime, $ticket->RespTime, $ticket->ArrivalTime, $ticket->RepairformSts, $ticket->MaintianComTel, $ticket->GivenArrivalTime, $ticket->Mobile, $ticket->ebs_id];
         $cellData[] = $cell;
     }
     Excel::create(time(), function ($excel) use($cellData) {
         $excel->sheet('data', function ($sheet) use($cellData) {
             $sheet->rows($cellData);
         });
     })->export('xls');
 }
Ejemplo n.º 4
0
 public function export(Request $request)
 {
     $tag = $request->tag;
     $ids = $request->session()->get($tag . '.tids', array());
     //        if(count($ids) == 0){
     //            return json_encode(array('msg'=>'请选择要导出的数据'));
     //        }
     $heads = ['地区', '记录时间', '工单编号', '前置编号', '工单开始时间', '未响应时间', '是否响应', '到场超时时间', '故障内容', '机构名称', '安装地址', '型号', '品牌', '反馈工程师', '报修时间', '响应时间', '到场认证时间', '报修状态', '厂商的维保电话', '厂商给出的预计到达时间', '农行报修人的电话', 'EBS返回的编码'];
     $cellData[] = $heads;
     foreach ($ids as $id) {
         $ticket = Ticket::find($id);
         $location = '';
         if ($ticket->location_id != 0) {
             $nhserver = Nhserver::find($ticket->location_id);
             if ($nhserver) {
                 $location = $nhserver->province;
             }
         }
         $cell = [$location, $ticket->time_log, $ticket->WFormId, $ticket->Identifier, $ticket->WFormSetTime, $ticket->ReplyDue, $ticket->IsChecked, $ticket->ArriveDue, $ticket->WFormContent, $ticket->OrgName, $ticket->InstallAddress, $ticket->ModelId, $ticket->BrandId, $ticket->Engineer, $ticket->RepairCreateTime, $ticket->RespTime, $ticket->ArrivalTime, $ticket->RepairformSts, $ticket->MaintianComTel, $ticket->GivenArrivalTime, $ticket->Mobile, $ticket->ebs_id];
         $cellData[] = $cell;
     }
     Excel::create(time(), function ($excel) use($cellData) {
         $excel->sheet('data', function ($sheet) use($cellData) {
             $sheet->rows($cellData);
         });
     })->export('xls');
 }