Model\Message::getMessageByUid PHP Method

getMessageByUid() public static method

Get push message by userId
public static getMessageByUid ( string $userId = '-1' ) : array
$userId string
return array
    public static function getMessageByUid($userId = '-1')
    {
        $stn = DB::getInstance()->prepare("SELECT * FROM message WHERE LOCATE(?, pushUsers)>0 AND pushEndTime>? ORDER BY id ASC");
        $stn->bindValue(1, $userId, DB::PARAM_STR);
        $stn->bindValue(2, time(), DB::PARAM_INT);
        $stn->execute();
        return $stn->fetchAll(DB::FETCH_CLASS, __CLASS__);
    }