1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- /* indent size: 2 */
- module.exports = app => {
- const DataTypes = app.Sequelize;
- const Model = app.model.define('ShippingsConfig', {
- shipping_id: {
- type: DataTypes.INTEGER(10).UNSIGNED,
- allowNull: false,
- primaryKey: true,
- autoIncrement: true
- },
- shipping_name: {
- type: DataTypes.STRING(255),
- allowNull: true
- },
- shipping_logo: {
- type: DataTypes.STRING(255),
- allowNull: true
- },
- shipping_params_index: {
- type: DataTypes.STRING(255),
- allowNull: true
- },
- shipping_status: {
- type: DataTypes.INTEGER(1).UNSIGNED,
- allowNull: true
- },
- shipping_sort: {
- 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_shippings_config'
- });
- Model.associate = function() {
- //关联管理员表
- Model.belongsTo(app.model.AdminUser,{foreignKey:'admin_id',targetKey:'admin_id',as:'admin_user'});
- }
- //同步:没有就新建,有就不变
- Model.sync();
- return Model;
- };
|