def getUserByUsername(username): try: sql = "select count(1) from user where username='******';" % username return dbmysql.first(sql) except Exception as e: utils.logger.error(e) return None
def getUserById(id): try: sql = "select * from user where id=%s;" % id return dbmysql.first(sql) except Exception as e: utils.logger.error(e) return None
def getUserByUserPass(username, password): try: sql = "select * from user where username='******' and password='******';" % (username, password) return dbmysql.first(sql) except Exception as e: utils.logger.error(e) return None