소스 검색

+prodid 9000...9006, ping reconnect

David 9 년 전
부모
커밋
f20dac6fa8
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      back/db.py

+ 3 - 1
back/db.py

@@ -8,6 +8,8 @@ class db():
 	def get_cursor(self):
 		if not self.conn.open:
 			self.connect()
+
+		self.conn.ping(reconnect=True)
 		try:
 			cur = self.conn.cursor()
 		except:
@@ -67,7 +69,7 @@ class db():
 		ret=[]
 		if _id is None:
 			cur = self.get_cursor()
-			cur.execute("SELECT id, nombre, precio, stock > 0 as disponible, stock < 25 as low, stock FROM productos where id between 1000 and 2999 and id not in (1019, 1014, 2014, 1015, 2015, 1047, 2038, 2030)")
+			cur.execute("SELECT id, nombre, precio, stock > 0 as disponible, stock < 25 as low, stock FROM productos where (id between 1000 and 2999 and id not in (1019, 1014, 2014, 1015, 2015, 1047, 2038, 2030)) or (id between 9000 and 9006)")
 			for row in cur.fetchall():
 				row["cantidad"]=0
 				ret.append(row)