Ejemplo n.º 1
0
 def delUserInfo(self, id):
     sql = "delete from user where id={}".format(id)
     print(sql)
     res = site_db.execute_sql(sql)
     return res
Ejemplo n.º 2
0
 def updateUserInfo(self, name, password, id):
     sql = "update user set username='******', password='******' where id={}".format(
         name, password, id)
     # print(sql)
     res = site_db.execute_sql(sql)
     return res
Ejemplo n.º 3
0
 def getUserByName(self, name):
     sql = "select id, username, password, update_time  from user where username = '******'".format(
         name)
     res = site_db.execute_sql(sql)
     return res
Ejemplo n.º 4
0
 def getUserById(self, id):
     sql = "select id, username, password, update_time  from user where id = {}".format(
         id)
     res = site_db.execute_sql(sql)
     return res
Ejemplo n.º 5
0
 def getUser(self):
     sql = "select id, username, password, update_time  from user"
     res = site_db.execute_sql(sql)
     return res
Ejemplo n.º 6
0
 def getComment(self, id):
     sql = "select t.id as site_id, t.site_name, c.id, c.userName, c.goal, c.publishDate, c.message from travel.siteandcomment as s join comments as c on c.id = s.comment_id join site as t on t.id = s.site_id where site_id='{}';".format(
         id)
     res = site_db.execute_sql(sql)
     print(res)
     return res