123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- /* indent size: 2 */
- module.exports = app => {
- const DataTypes = app.Sequelize;
- const Model = app.model.define('PaysConfig', {
- pay_id: {
- type: DataTypes.INTEGER(10).UNSIGNED,
- allowNull: false,
- primaryKey: true,
- autoIncrement: true
- },
- pay_name: {
- type: DataTypes.STRING(255),
- allowNull: true
- },
- pay_logo: {
- type: DataTypes.STRING(255),
- allowNull: true
- },
- pay_params_index: {
- type: DataTypes.STRING(255),
- allowNull: true
- },
- pay_status: {
- type: DataTypes.INTEGER(1).UNSIGNED,
- allowNull: true
- },
- pay_sort: {
- type: DataTypes.INTEGER(1).UNSIGNED,
- allowNull: true
- },
- is_default: {
- type: DataTypes.INTEGER(1).UNSIGNED,
- allowNull: true
- },
- admin_id: {
- type: DataTypes.INTEGER(10).UNSIGNED,
- allowNull: true
- },
- update_time: {
- type: DataTypes.TIME,
- allowNull: true,
- },
- create_time: {
- type: DataTypes.DATE,
- allowNull: true
- }
- }, {
- tableName: 'szj_pays_config'
- });
- Model.associate = function() {
- //关联管理员表
- Model.belongsTo(app.model.AdminUser,{foreignKey:'admin_id',targetKey:'admin_id',as:'admin_user'});
- }
- //同步:没有就新建,有就不变
- Model.sync();
- return Model;
- };
|