payments.js 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. /* indent size: 2 */
  2. module.exports = app => {
  3. const DataTypes = app.Sequelize;
  4. const Model = app.model.define('Payments', {
  5. payment_id: {
  6. type: DataTypes.INTEGER(10).UNSIGNED,
  7. allowNull: false,
  8. primaryKey: true,
  9. autoIncrement: true
  10. },
  11. user_id: {
  12. type: DataTypes.INTEGER(10).UNSIGNED,
  13. allowNull: true
  14. },
  15. pay_id: {
  16. type: DataTypes.INTEGER(10).UNSIGNED,
  17. allowNull: true
  18. },
  19. out_trade_no: {
  20. type: DataTypes.STRING(30),
  21. allowNull: true
  22. },
  23. total_fee: {
  24. type: DataTypes.INTEGER(10).UNSIGNED,
  25. allowNull: true
  26. },
  27. trade_type: {
  28. type: DataTypes.STRING(100),
  29. allowNull: true
  30. },
  31. transaction_id: {
  32. type: DataTypes.STRING(255),
  33. allowNull: true
  34. },
  35. time_end: {
  36. type: DataTypes.STRING(100),
  37. allowNull: true
  38. },
  39. openid: {
  40. type: DataTypes.STRING(100),
  41. allowNull: true
  42. },
  43. sub_is_subscribe: {
  44. type: DataTypes.STRING(10),
  45. allowNull: true
  46. },
  47. sub_openid: {
  48. type: DataTypes.STRING(100),
  49. allowNull: true
  50. },
  51. is_subscribe: {
  52. type: DataTypes.STRING(10),
  53. allowNull: true
  54. },
  55. fee_type: {
  56. type: DataTypes.STRING(100),
  57. allowNull: true
  58. },
  59. bank_type: {
  60. type: DataTypes.STRING(100),
  61. allowNull: true
  62. },
  63. cash_fee: {
  64. type: DataTypes.INTEGER(10).UNSIGNED,
  65. allowNull: true
  66. },
  67. is_refund: {
  68. type: DataTypes.INTEGER(1).UNSIGNED,
  69. allowNull: true
  70. },
  71. refund_trade_no: {
  72. type: DataTypes.STRING(100),
  73. allowNull: true
  74. },
  75. refund_desc: {
  76. type: DataTypes.STRING(255),
  77. allowNull: true
  78. },
  79. refund_time: {
  80. type: DataTypes.DATE,
  81. allowNull: true
  82. },
  83. create_time: {
  84. type: DataTypes.TIME,
  85. allowNull: true
  86. }
  87. }, {
  88. tableName: 'szj_payments'
  89. });
  90. Model.associate = function() {
  91. }
  92. //同步:没有就新建,有就不变
  93. Model.sync();
  94. return Model;
  95. };