diff --git a/instock/web/dataIndicatorsHandler.py b/instock/web/dataIndicatorsHandler.py index aeedd486e..b6718fa3b 100644 --- a/instock/web/dataIndicatorsHandler.py +++ b/instock/web/dataIndicatorsHandler.py @@ -51,13 +51,16 @@ def get(self): try: table_name = tbs.TABLE_CN_STOCK_ATTENTION['name'] if otype == '1': - sql = f"DELETE FROM `{table_name}` WHERE `code` = '{code}'" + # sql = f"DELETE FROM `{table_name}` WHERE `code` = '{code}'" + sql = f"DELETE FROM `{table_name}` WHERE `code` = %s" + self.db.query(sql,code) else: - sql = f"INSERT INTO `{table_name}`(`datetime`, `code`) VALUE('{datetime.datetime.now()}','{code}')" - self.db.query(sql) + # sql = f"INSERT INTO `{table_name}`(`datetime`, `code`) VALUE('{datetime.datetime.now()}','{code}')" + sql = f"INSERT INTO `{table_name}`(`datetime`, `code`) VALUE(%s, %s)" + self.db.query(sql,datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S.%f"),code) except Exception as e: err = {"error": str(e)} - logging.info(err) - self.write(err) - return + # logging.info(err) + # self.write(err) + # return self.write("{\"data\":[{}]}") \ No newline at end of file diff --git a/instock/web/dataTableHandler.py b/instock/web/dataTableHandler.py index 3336ae971..4b485dbcd 100644 --- a/instock/web/dataTableHandler.py +++ b/instock/web/dataTableHandler.py @@ -50,10 +50,12 @@ def get(self): date = self.get_argument("date", default=None, strip=False) web_module_data = sswmd.stock_web_module_data().get_data(name) self.set_header('Content-Type', 'application/json;charset=UTF-8') + if date is None: where = "" else: - where = f" WHERE `date` = '{date}'" + # where = f" WHERE `date` = '{date}'" + where = f" WHERE `date` = %s" order_by = "" if web_module_data.order_by is not None: @@ -64,6 +66,6 @@ def get(self): order_columns = f",{web_module_data.order_columns}" sql = f" SELECT *{order_columns} FROM `{web_module_data.table_name}`{where}{order_by}" + data = self.db.query(sql,date) - data = self.db.query(sql) self.write(json.dumps(data, cls=MyEncoder)) diff --git a/instock/web/templates/index.html b/instock/web/templates/index.html index 158c5a459..2ae544f10 100644 --- a/instock/web/templates/index.html +++ b/instock/web/templates/index.html @@ -164,7 +164,7 @@

功能介绍

二日K线模式,分多头母子与空头母子,两者相反,以多头母子为例,在下跌趋势中,第一日K线长阴, 第二日开盘价收盘价在第一日价格振幅之内,为阳线,预示趋势反转,股价上升。 27、十字孕线 - 二日K线模式,与母子县类似,若第二日K线是十字线, 便称为十字孕线,预示着趋势反转。 + 二日K线模式,与母子线类似,若第二日K线是十字线, 便称为十字孕线,预示着趋势反转。 28、风高浪大线 三日K线模式,具有极长的上/下影线与短的实体,预示着趋势反转。