Exemplo n.º 1
0
 def create(cls, cid, pid, sid):
     """根据影院ID,排期ID和座位ID,创建订单对象"""
     order = cls()
     order.oid = '%s%s%s' % (tetime.now(), randint(100000, 999999), pid)
     order.cid = cid
     order.pid = pid
     order.sid = ','.join(str(i) for i in sid)
     return order
Exemplo n.º 2
0
 def create(cls, cid, pid, sid):
     '''根据影院ID,排期ID和座位ID,创建订单对象'''
     order = cls()
     order.oid = "%s%s%s" % (tetime.now(), randint(100000, 999999), pid)
     order.cid = cid
     order.pid = pid
     order.sid = ",".join(str(i) for i in sid)
     return order
Exemplo n.º 3
0
 def create(cls, cid, pid, sid):
     order = cls()
     order.oid = '%s%s%s' % (now(), randint(100000, 999999), pid)
     order.cid = cid
     order.pid = pid
     if type(sid) == list:
         order.sid = ','.join(str(i) for i in sid)
     else:
         order.sid = sid
     return order
Exemplo n.º 4
0
 def create(cls, cid, pid, sid):
     order = cls()
     order.oid = '%s%s%s' % (tetime.now(), randint(100000, 999999), pid)
     order.cid = cid
     order.pid = pid
     # 如果座位id是列表,就拼接成字符串
     if type(sid) == list:
         cls.join = ','.join(str(i) for i in sid)
         order.sid = cls.join
     else:
         order.sid = sid
     return order
Exemplo n.º 5
0
    def create(cls, cid, pid, sid):
        order = cls()
        # 购买时间+随机6位数字+排期id
        order.oid = "%s%s%s" % (tetime.now(), randint(100000, 999999), pid)

        order.pid = pid
        order.cid = cid

        # 对sid进行组合,以便进行保存
        if type(sid) == list:
            order.sid = ",".join(str(i) for i in sid)
        else:
            order.sid = sid

        return order