123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- /* indent size: 2 */
- // eslint-disable-next-line strict
- module.exports = app => {
- const DataTypes = app.Sequelize;
- const Model = app.model.define('PartnerInfo', {
- id: {
- type: DataTypes.INTEGER(10).UNSIGNED,
- allowNull: false,
- primaryKey: true,
- autoIncrement: true,
- },
- name: {
- type: DataTypes.STRING(16),
- allowNull: true,
- },
- address: {
- type: DataTypes.STRING(128),
- allowNull: true,
- },
- tel_num: {
- type: DataTypes.STRING(16),
- allowNull: true,
- },
- opening_time: {
- type: DataTypes.STRING(64),
- allowNull: true,
- },
- rate_from_partner: {
- type: DataTypes.FLOAT(10, 2),
- allowNull: true,
- },
- rate_default: {
- type: DataTypes.FLOAT(10, 2),
- allowNull: true,
- },
- user_id: {
- type: DataTypes.INTEGER(16).UNSIGNED,
- allowNull: true,
- },
- create_time: {
- type: DataTypes.TIME,
- allowNull: true,
- },
- update_time: {
- type: DataTypes.TIME,
- allowNull: true,
- },
- partner_img: {
- type: DataTypes.STRING(128),
- allowNull: true,
- },
- county_name: {
- type: DataTypes.STRING(16),
- allowNull: true,
- },
- router_name: {
- type: DataTypes.STRING(32),
- allowNull: true,
- },
- top: {
- type: DataTypes.INTEGER(1).UNSIGNED,
- allowNull: true,
- },
- online: {
- type: DataTypes.INTEGER(1).UNSIGNED,
- allowNull: true,
- },
- order_amount: {
- type: DataTypes.INTEGER(8).UNSIGNED,
- allowNull: true,
- },
- latitude: {
- type: DataTypes.FLOAT(10, 6),
- allowNull: true,
- },
- longitude: {
- type: DataTypes.FLOAT(11, 6),
- allowNull: true,
- },
- category_id: {
- type: DataTypes.INTEGER(10),
- allowNull: true,
- },
- partner_fees: {
- type: DataTypes.INTEGER(10),
- allowNull: true,
- },
- }, {
- tableName: 'szj_partner_info',
- });
- Model.associate = function() {
- // 关联用户表
- Model.belongsTo(app.model.Users, { foreignKey: 'user_id', targetKey: 'user_id', as: 'user' });
- };
- // 同步:没有就新建,有就不变
- Model.sync();
- return Model;
- };
|