public function _indexDiagram() { $codeFlowPhase = CodeFlowPhase::all(['ID', 'NAME']); $loProductionUnit = LoProductionUnit::all(['ID', 'NAME']); $loArea = LoArea::where(['PRODUCTION_UNIT_ID' => $loProductionUnit[0]->ID])->get(['ID', 'NAME']); $facility = Facility::where(['AREA_ID' => $loArea[0]->ID])->get(['ID', 'NAME']); $intObjectType = IntObjectType::where(['DISPLAY_TYPE' => 1])->get(['CODE', 'NAME']); $tmp = ucwords($intObjectType[0]->NAME); $mode = 'App\\Models\\' . str_replace(' ', '', $tmp); $type = $mode::where(['FACILITY_ID' => $facility[0]->ID])->get(['ID', 'NAME']); return view('front.diagram', ['codeFlowPhase' => $codeFlowPhase, 'loProductionUnit' => $loProductionUnit, 'loArea' => $loArea, 'facility' => $facility, 'intObjectType' => $intObjectType, 'type' => $type]); }
/** * @return \Illuminate\Routing\Route|null|string */ public function ingnoreId() { $id = $this->route('facility'); $name = $this->input('name'); return Facility::where(compact('id', 'name'))->exists() ? $id : ''; }
public function getUomType($uom_type = null, $facility_id) { if ($uom_type == null) { $uom_type = StandardUom::where('facility_id', $facility_id)->select('UOM_TYPE')->first(); if ($uom_type == null) { $uom_type = Facility::where('facility_id', $facility_id)->select('UOM_TYPE')->first(); } } return $uom_type; }