pays_config.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /* indent size: 2 */
  2. module.exports = app => {
  3. const DataTypes = app.Sequelize;
  4. const Model = app.model.define('PaysConfig', {
  5. pay_id: {
  6. type: DataTypes.INTEGER(10).UNSIGNED,
  7. allowNull: false,
  8. primaryKey: true,
  9. autoIncrement: true
  10. },
  11. pay_name: {
  12. type: DataTypes.STRING(255),
  13. allowNull: true
  14. },
  15. pay_logo: {
  16. type: DataTypes.STRING(255),
  17. allowNull: true
  18. },
  19. pay_params_index: {
  20. type: DataTypes.STRING(255),
  21. allowNull: true
  22. },
  23. pay_status: {
  24. type: DataTypes.INTEGER(1).UNSIGNED,
  25. allowNull: true
  26. },
  27. pay_sort: {
  28. type: DataTypes.INTEGER(1).UNSIGNED,
  29. allowNull: true
  30. },
  31. is_default: {
  32. type: DataTypes.INTEGER(1).UNSIGNED,
  33. allowNull: true
  34. },
  35. admin_id: {
  36. type: DataTypes.INTEGER(10).UNSIGNED,
  37. allowNull: true
  38. },
  39. update_time: {
  40. type: DataTypes.TIME,
  41. allowNull: true,
  42. },
  43. create_time: {
  44. type: DataTypes.DATE,
  45. allowNull: true
  46. }
  47. }, {
  48. tableName: 'szj_pays_config'
  49. });
  50. Model.associate = function() {
  51. //关联管理员表
  52. Model.belongsTo(app.model.AdminUser,{foreignKey:'admin_id',targetKey:'admin_id',as:'admin_user'});
  53. }
  54. //同步:没有就新建,有就不变
  55. Model.sync();
  56. return Model;
  57. };