Subversion Repositories SmartDukaan

Rev

Rev 14513 | Rev 14578 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 14513 Rev 14526
Line 112... Line 112...
112
        result = cursor.fetchall()
112
        result = cursor.fetchall()
113
        return result
113
        return result
114
    finally:
114
    finally:
115
        conn.close() 
115
        conn.close() 
116
 
116
 
-
 
117
def getOrdersByTag(tagName, storeId):
-
 
118
    try:
-
 
119
        conn = getDbConnection()
-
 
120
        cursor = conn.cursor()
-
 
121
        query = "select o.* from users u join order_view o on u.id = o.user_id join clicks c on c.user_id = u.id where c.tag = '%s' and o.status='ORDER_CREATED' and o.store_id=%s"
-
 
122
        cursor.execute(query%(tagName, storeId))
-
 
123
        result = cursor.fetchall()
-
 
124
        return result
-
 
125
    finally:
-
 
126
        conn.close() 
-
 
127
 
117
def main():
128
def main():
118
    print getOrdersAfterDate(datetime.now() - timedelta(days=10), 3)
129
    print getOrdersAfterDate(datetime.now() - timedelta(days=10), 3)
119
 
130
 
120
 
131
 
121
if __name__ == '__main__':
132
if __name__ == '__main__':