class AI_ConstantModel(db.Model): __tablename__ = 'AI_Constant' id = db.Column(db.Integer, primary_key=True) const_name = db.Column(db.String(length=64), nullable=False) const_value_male = db.Column(db.DECIMAL(10, 3), nullable=False) const_value_female = db.Column(db.DECIMAL(10, 3), nullable=False) const_child_16 = db.Column(db.DECIMAL(10, 3), nullable=False) sigma = db.Column(db.DECIMAL(10, 3), nullable=False)
class Shops(db.Model): # 绑定的查询数据库 __bind_key__ = 'JDTracker' id = db.Column(db.Integer, primary_key=True, autoincrement=True) shopId = db.Column(db.String(32)) vendorId = db.Column(db.String(32)) shopname = db.Column(db.String(32)) shopdiscount = db.Column(db.DECIMAL(10,4))
class Hissorder(db.Model): __tablename__ = 'hissorder' sorderid = db.Column(db.String(64), primary_key=True, default=str(uuid1())) orderid = db.Column(db.String(64), nullable=False) addressid = db.Column(db.String(64), nullable=False) sellerid = db.Column(db.String(64), nullable=False) userid = db.Column(db.String(64), nullable=False) goodsname = db.Column(db.String(64), nullable=False) price = db.Column(db.DECIMAL(10, 2), nullable=False) count = db.Column(db.Integer, nullable=False) unit = db.Column(db.String(32), nullable=False) sumunit = db.Column(db.DECIMAL(12, 2), nullable=False) state = db.Column(db.String(4), default='1') createtime = db.Column(db.DateTime, default=str(datetime.now())) def db2json(self): data = to_json(self) return data
class Activities(db.Model): # 绑定的查询数据库 __bind_key__ = 'JDTracker' __tablename__ = 'activities' id = db.Column(db.Integer, primary_key=True, autoincrement=True) activityId = db.Column(db.String(32)) vendorId = db.Column(db.String(32)) activityname = db.Column(db.String(32)) activitydiscount = db.Column(db.DECIMAL(10,4))
class Hisorder(db.Model): __tablename__ = 'hisorder' orderid = db.Column(db.String(64), primary_key=True, default=str(uuid1())) addressid = db.Column(db.String(64), nullable=False) userid = db.Column(db.String(64), nullable=False) sumtotal = db.Column(db.DECIMAL(12, 2), nullable=False) createtime = db.Column(db.DateTime, default=str(datetime.now())) def db2json(self): data = to_json(self) return data
class Forecast(db.Model): # 绑定的查询数据库 __tablename__ = 'forecast' __table_args__ = {'schema': 'JDTracker'} id = db.Column(db.Integer, primary_key=True, autoincrement=True) # jd的商品id productId = db.Column(db.String(32)) vendorId = db.Column(db.String(32)) articleNumber = db.Column(db.String(32)) title = db.Column(db.String(255)) # jd的商品标价 price = db.Column(db.DECIMAL(10, 2)) # 打完折的价格 finalPrice = db.Column(db.DECIMAL(10, 2)) # 尺码 size = db.Column(db.String(32)) # 得物现货价格 duPrice = db.Column(db.DECIMAL(10, 2)) # 得物销量 duSoldNum = db.Column(db.Integer) # 价差 gap = db.Column(db.DECIMAL(10, 2)) # 到手利润 interest = db.Column(db.DECIMAL(10, 2)) # 到手利润率 interestRate = db.Column(db.DECIMAL(10, 4)) # 商品图片 imageUrl = db.Column(db.String(255)) # 商品地址 itemUrl = db.Column(db.String(255)) # 状态 0 有货 1 无货 stock = db.Column(db.Integer) create_at = db.Column(db.DateTime, default=datetime.datetime.now)
class ItemCar(db.Model): __tablename__ = 'itemcar' sorderid = db.Column(db.String(64), primary_key=True, default=str(uuid1())) userid = db.Column(db.String(64), nullable=False) goodsid = db.Column(db.String(64), nullable=False) goodsname = db.Column(db.String(64), nullable=False) count = db.Column(db.Integer(), nullable=False) price = db.Column(db.DECIMAL(10, 2), nullable=False) unit = db.Column(db.String(32), nullable=False) sumunit = db.Column(db.DECIMAL(12, 2)) createtime = db.Column(db.DateTime, default=str(datetime.now())) # 将db转换成json格式 def db2json(self): data = self.__dict__ if "_sa_instance_state" in data: del data["_sa_instance_state"] if 'price' in data: data['price'] = float(data['price']) if 'sumunit' in data: data['sumunit'] = float(data['sumunit']) return data
class AI_Constant_APPModel(db.Model): __tablename__ = 'AI_Constant_APP' id = db.Column(db.Integer, primary_key=True) const_id = db.Column(db.Integer, nullable=False) const_name = db.Column(db.String(length=64), nullable=False) const_value_male = db.Column(db.DECIMAL(10, 3), nullable=False) const_value_female = db.Column(db.DECIMAL(10, 3), nullable=False) const_child_16 = db.Column(db.DECIMAL(10, 3), nullable=False) const_min = db.Column(db.DECIMAL(10, 3), nullable=False) const_max = db.Column(db.DECIMAL(10, 3), nullable=False) range_min = db.Column(db.DECIMAL(10, 3), nullable=False) range_max = db.Column(db.DECIMAL(10, 3), nullable=False) const_sigma = db.Column(db.DECIMAL(10, 3), nullable=False) const_description = db.Column(db.String(length=1024), nullable=False)
class Buyitem(db.Model): id = db.Column(db.Integer, primary_key=True) userId = db.Column(db.Integer, db.ForeignKey('user.id')) name = db.Column(db.String(255)) articleNumber = db.Column(db.String(255)) size = db.Column(db.String(32)) buyCost = db.Column(db.DECIMAL(10,2)) buyCharge = db.Column(db.DECIMAL(10,2)) soldTypeId = db.Column(db.Integer) soldCharge = db.Column(db.DECIMAL(10,2)) imageUrl = db.Column(db.String(255)) buyTypeId = db.Column(db.Integer) soldPrice = db.Column(db.DECIMAL(10,2)) soldPriceExpect = db.Column(db.DECIMAL(10,2)) profitExpect = db.Column(db.DECIMAL(10,2)) profit = db.Column(db.DECIMAL(10,2)) interestRate = db.Column(db.DECIMAL(10,2)) interestRateExpect = db.Column(db.DECIMAL(10,2)) goodStatus = db.Column(db.Integer) buyTime = db.Column(db.String(32)) soldTime = db.Column(db.String(32)) create_at = db.Column(db.DATETIME, default=datetime.datetime.now)
class Goods(db.Model): __tablename__ = 'goods' goodsid = db.Column(db.String(64), primary_key=True, default=str(uuid1())) menuid = db.Column(db.String(64), nullable=False) sellerid = db.Column(db.String(64), nullable=False) goodsname = db.Column(db.String(64), nullable=False) count = db.Column(db.Integer, nullable=False) price = db.Column(db.DECIMAL(10, 2), nullable=False) spic = db.Column(db.String(64), nullable=False) bpic = db.Column(db.String(64), nullable=False) unit = db.Column(db.String(32), nullable=False) online = db.Column(db.String(2), default='1') isfirstpageshow = db.Column(db.String(2), default='1') isshow = db.Column(db.String(2), default='1') selpoint = db.Column(db.Text(128)) delflag = db.Column(db.String(2), default='0') createtime = db.Column(db.DateTime, default=str(datetime.now())) updatetime = db.Column(db.DateTime, default=str(datetime.now())) def db2json(self): data = to_json(self) return data
class AI_USER_APPKEYModel(db.Model, Timestamp): __tablename__ = 'AI_USER_APPKEY' id = db.Column(db.Integer, primary_key=True) log_id = db.Column(db.String(length=128), nullable=False) cuid = db.Column(db.Integer, nullable=False) page_type = db.Column(db.Integer, nullable=False) tree_height = db.Column(db.DECIMAL(10, 3), nullable=False) tree_width = db.Column(db.DECIMAL(10, 3), nullable=False) tree_area = db.Column(db.DECIMAL(10, 3), nullable=False) tree_on_left = db.Column(db.DECIMAL(10, 3), nullable=False) tree_on_right = db.Column(db.DECIMAL(10, 3), nullable=False) tree_on_top = db.Column(db.DECIMAL(10, 3), nullable=False) tree_on_bottom = db.Column(db.DECIMAL(10, 3), nullable=False) tree_on_page = db.Column(db.DECIMAL(10, 3), nullable=False) tree_crown_height = db.Column(db.DECIMAL(10, 3), nullable=False) tree_crown_width = db.Column(db.DECIMAL(10, 3), nullable=False) tree_crown_area = db.Column(db.DECIMAL(10, 3), nullable=False) tree_crown_area_1 = db.Column(db.DECIMAL(10, 3), nullable=False) tree_crown_area_2 = db.Column(db.DECIMAL(10, 3), nullable=False) tree_crown_area_3 = db.Column(db.DECIMAL(10, 3), nullable=False) tree_crown_area_4 = db.Column(db.DECIMAL(10, 3), nullable=False) tree_crown_area_5 = db.Column(db.DECIMAL(10, 3), nullable=False) tree_crown_area_6 = db.Column(db.DECIMAL(10, 3), nullable=False) tree_trunk_height = db.Column(db.DECIMAL(10, 3), nullable=False) tree_trunk_width = db.Column(db.DECIMAL(10, 3), nullable=False) tree_trunk_area = db.Column(db.DECIMAL(10, 3), nullable=False) tree_root_height = db.Column(db.DECIMAL(10, 3), nullable=False) tree_root_width = db.Column(db.DECIMAL(10, 3), nullable=False) tree_root_area = db.Column(db.DECIMAL(10, 3), nullable=False) xinzhi_value = db.Column(db.DECIMAL(10, 3), nullable=False) siwei_value = db.Column(db.DECIMAL(10, 3), nullable=False) qingxu_value = db.Column(db.DECIMAL(10, 3), nullable=False) juese_value = db.Column(db.DECIMAL(10, 3), nullable=False) nengli_value = db.Column(db.DECIMAL(10, 3), nullable=False) qianyishi_value = db.Column(db.DECIMAL(10, 3), nullable=False) log_time = db.Column(db.DateTime, nullable=True)