Class: Ucenter::Interface::App

Inherits:
Base
  • Object
show all
Defined in:
lib/ucenter/interface/app.rb

Instance Method Summary collapse

Methods inherited from Base

#db_client, #get, #initialize, #post

Constructor Details

This class inherits a constructor from Ucenter::Interface::Base

Instance Method Details

#get_apps(col = '*', where = '') ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'lib/ucenter/interface/app.rb', line 4

def get_apps(col = '*', where = '')
  col = db_client.escape(col)
  where = db_client.escape(where)
  data = db_client.query("SELECT #{col} FROM #{Ucenter::Config.uc_dbtablepre}applications #{where!="" ? " WHERE #{where} " : ""}").to_a
  data.each_with_index do |item,index|
    item['extra'] = Ucenter::Tools::PHP.unserialize(item['extra'])
    data[index] = item
  end
end