Exemplo n.º 1
0
 /**
  * @param string $status
  * @return Zend_Db_Expr
  * @throws \Exception
  */
 public static function getFriendListQuery($status = "> 0")
 {
     return new Zend_Db_Expr(Cunity::get("db")->select()->from(Mysqli::getDbprefix() . "relations", new Zend_Db_Expr("(CASE WHEN sender = " . $_SESSION['user']->userid . " THEN receiver WHEN receiver = " . $_SESSION['user']->userid . " THEN sender END)"))->where("status" . $status)->where("sender=? OR receiver=?", $_SESSION['user']->userid));
 }
Exemplo n.º 2
0
 /**
  * @param string $status
  * @return Zend_Db_Expr
  * @throws \Exception
  */
 public static function getEventsListQuery($status = "> 0")
 {
     return new Zend_Db_Expr(Cunity::get("db")->select()->from(Mysqli::getDbprefix() . "events_guests", "eventid")->where("status" . $status)->where("userid=?", $_SESSION['user']->userid));
 }