public function actualizarCondiciones() { $legacy_ocs = $this->consultarOcsLegacy(); foreach ($legacy_ocs as $oc_legacy) { $oc_nueva = Oc::where('oc', '=', $oc_legacy->oc)->first(); $this->relacionarCondiciones($oc_legacy->oc, $oc_nueva); } }
private function actualizarEstatusReq($req_id) { $ocs = Oc::where('req_id', $req_id)->get(); $estatus_req = 'Pagada'; foreach ($ocs as $oc) { if ($oc->estatus != 'Pagada') { $estatus_req = 'Autorizada'; } } $req = Req::find($req_id); if ($req->estatus != $estatus_req) { $req->estatus = $estatus_req; $req->save(); } }