public function actionDeliverylist() { $driver = Driver::getUserId($_REQUEST['token']); $lists = KurirDeliveryList::model()->findAllByAttributes(array('user_id' => $driver)); $return = array(); foreach ($lists as $list) { $return[] = array($list->awb, $this->getShipmentByAwb($list->awb, 'receiver_address')); } echo CJSON::encode($this->statusSuccess($return)); }
/** * 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 the ID of the model to be loaded */ public function loadModel($id) { $model = KurirDeliveryList::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }