Commit 15efb07d by lzzzzl

更新attr_values mongo处理

parent dc6bfb23
Showing with 6 additions and 3 deletions
......@@ -219,7 +219,8 @@ class ParamData(object):
@staticmethod
def get_attr_name(attr_id, class_conn):
sql = "SELECT attr_name FROM lie_class_attr WHERE attr_id=%s" % attr_id
return DBHandler.read(class_conn, sql)
res = DBHandler.read(class_conn, sql)
return res[0][0] if len(res) > 0 else ''
"""
获取参数值
......@@ -227,7 +228,8 @@ class ParamData(object):
@staticmethod
def get_attr_value(attr_value_id, class_conn):
sql = "SELECT value FROM lie_class_attr_value WHERE attr_value_id=%s" % attr_value_id
return DBHandler.read(class_conn, sql)
res = DBHandler.read(class_conn, sql)
return res[0][0] if len(res) > 0 else ''
"""
获取参数单位
......@@ -235,7 +237,8 @@ class ParamData(object):
@staticmethod
def get_attr_unit(attr_unit_id, class_conn):
sql = "SELECT attr_unit_name FROM lie_class_attr_unit WHERE attr_unit_id=%s" % attr_unit_id
return DBHandler.read(class_conn, sql)
res = DBHandler.read(class_conn, sql)
return res[0][0] if len(res) > 0 else ''
"""
获取SPU 数据
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment