public function getOrdenCompraCitaCedi($miNumeroOrdenCompra) { // @todo Please modify the following code to remove attributes that should not be searched. $criteria = new CDbCriteria(); $criteria->select = 'OC.*, LF.IdTransportador, AE.DiaSemana, AE.HoraDia, TR.Nombre AS NombreTransportador, ' . ' CalcularFechaEntregaMcia(OC.FechaRegistroOrdenCompra,AE.DiaSemana) AS FechaSolicitudCita '; $criteria->alias = 'OC'; $criteria->join = 'LEFT JOIN m_LogisticaFabricante LF ON OC.IdFabricante = LF.IdFabricante ' . 'AND OC.IdCedi = LF.IdCedi ' . 'LEFT JOIN m_AcuerdosEntregaFabricante AE ON OC.IdFabricante = AE.IdFabricante ' . 'AND OC.IdCedi = AE.IdCedi ' . 'LEFT JOIN m_Transportador TR ON TR.IdTransportador = LF.IdTransportador '; $criteria->condition = 'LF.IdUsuarioResponsable=' . app()->user->id; $criteria->condition = 'OC.NumeroOrdenCompra=' . $miNumeroOrdenCompra; $laOrdenCompraCitaCedi = OrdenesCompraCitasCedi::model()->find($criteria); return $laOrdenCompraCitaCedi; }
/** * Returns the data model based on the primary key given in the GET variable. * If the data model is not found, an HTTP exception will be raised. * @param integer $id the ID of the model to be loaded * @return OrdenesCompraCitasCedi the loaded model * @throws CHttpException */ public function loadModel($id) { $model = OrdenesCompraCitasCedi::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }