Esempio n. 1
0
 public function getRepairPrint($repair_id)
 {
     $ymdnow = date("Y-m-d");
     $tnow = date("H:i:s");
     $job = DurableRepair::find($repair_id);
     if ($job->close_job_time == "" || $job->close_job_time == "00:00:00") {
         $sqlu = "UPDATE tb_durable_repair SET close_job_date = '{$ymdnow}', close_job_time = '{$tnow}'";
         $job->close_job_date = $ymdnow;
         $job->close_job_time = $tnow;
         $job->save();
     }
     $repair = DurableRepair::leftJoin('tb_sub_dept', 'tb_sub_dept.sub_dept_id', '=', 'tb_durable_repair.sub_dept_id')->leftJoin('tb_durable', 'tb_durable.durable_id', '=', 'tb_durable_repair.durable_id')->leftJoin('tb_durable_kind', function ($join) {
         $join->on('tb_durable_kind.durable_type_id', '=', 'tb_durable.durable_type_id')->on('tb_durable.durable_kind_id', '=', 'tb_durable_kind.durable_kind_id');
     })->leftJoin('tb_brand', 'tb_brand.brand_id', '=', 'tb_durable.brand_id')->leftJoin('tb_technical', 'tb_technical.technic_id', '=', 'tb_durable_repair.repair_get_name')->leftJoin('tb_technical as t2', 't2.technic_id', '=', 'tb_durable_repair.repair_care')->leftJoin('tb_cause', 'tb_cause.cause_id', '=', 'tb_durable_repair.cause_id')->select('tb_durable_repair.repair_id_get', 'tb_durable_repair.repair_date', 'tb_durable_repair.insert_time', 'tb_durable.sub_dept_id', 'tb_sub_dept.sub_dept_name', 'tb_durable_repair.sub_dept2', 'tb_durable_repair.repair_type', 'tb_durable_kind.durable_kind_sname', 'tb_durable_repair.amount', 'tb_durable.durable_date', 'tb_durable.durable_price', 'tb_brand.brand_name', 'tb_durable.durable_model', 'tb_durable_repair.durable_id', 'tb_durable_repair.ruin', 'tb_durable_repair.repair_name', 'tb_durable_repair.repair_device_send', DB::raw('tb_technical.technic_name AS get_name'), 'tb_durable_repair.repair_opr', 'tb_durable_repair.repair_result', 'tb_durable_repair.repair_result_detail1', 'tb_durable_repair.repair_device_type', 'tb_durable_repair.repair_result_detail3', 'tb_durable_repair.repair_out', 'tb_durable_repair.repair_in', 'tb_durable_repair.buy_replace', 'tb_durable.durable_location', 'tb_durable_repair.repair_location_tel', 'tb_durable_repair.repair_date_end', 'tb_durable_repair.repair_price_about', 't2.technic_name', 'tb_durable_repair.close_job_date', 'tb_durable_repair.close_job_time', 'tb_cause.cause_name', 'tb_durable_repair.approve_status', 'tb_durable_repair.approve_detail', 'tb_durable_repair.approve_name', 'tb_durable_repair.approve_date')->where('tb_durable_repair.repair_id', '=', $repair_id)->first();
     $device = DurableRepairDevice::select('device_list', 'device_size', 'device_amount')->where('repair_id', '=', $repair_id)->get();
     return View::make('durable.repair_print')->with(compact('repair', 'device'));
 }
Esempio n. 2
0
 public function getHelpMessage($id)
 {
     $repair = DurableRepair::find(Crypt::decrypt($id));
     $dept_name = DB::table('tb_dept')->where('dept_id', '=', $repair->dept_id)->first()->dept_name;
     $technical_name = DB::table('tb_technical')->where('technic_id', '=', $repair->repair_technician_name)->first();
     return View::make('helpdesk.help_message')->with(compact('repair', 'dept_name', 'technical_name'));
 }