public function getUserName($uid) { $query = DcmdUser::findOne($uid); if ($query) { return $query['username']; } return ""; }
public function getUserName($uid) { $ret = DcmdUser::findOne($uid); if ($ret) { return $ret['username']; } return ""; }
public function getOprName($uid) { $query = DcmdUser::findOne($uid); if ($query) { return $query->username; } return ""; }
public function getDepartment($uid) { $query = DcmdUser::findOne($uid); if (!$query) { return ""; } $ret = DcmdDepartment::findOne($query['depart_id']); if (!$ret) { return ""; } return $ret['depart_name']; }
/** * Finds the DcmdUser model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id * @return DcmdUser the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = DcmdUser::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }