Ejemplo n.º 1
0
 def weicbd_register(self, ghid, openid):
     db = Mysqldb()
     db.execute('''
         CREATE TABLE IF NOT EXISTS weicbd_mp_member_rel (
         id bigint NOT NULL AUTO_INCREMENT,
         ghid varchar(255) NULL,
         openid varchar(255) NULL,
         memberid bigint NULL,
         FOREIGN KEY (memberid) REFERENCES weicbd_member(id),
         PRIMARY KEY (id))''')
     result = db.fetchone(
         'select id, ghid, openid from weicbd_mp_member_rel where ghid = %s and openid = %s',
         (ghid, openid)) or (None, )
     if result is None:
         db.execute(
             'insert into weicbd_mp_member_rel (ghid,openid) values(%s,%s)',
             (ghid, openid))
         db.commit()
Ejemplo n.º 2
0
 def __init__(self):
     from db import Mysqldb
     self.db = Mysqldb()
     self.__create_table(self.db)
Ejemplo n.º 3
0
 def __init__(self):
     self.db = Mysqldb()
     self.__create_table(self.db)