users_cash_logs.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /* indent size: 2 */
  2. // eslint-disable-next-line strict
  3. module.exports = app => {
  4. const DataTypes = app.Sequelize;
  5. const Model = app.model.define('UsersCashLogs', {
  6. log_id: {
  7. type: DataTypes.INTEGER(10).UNSIGNED,
  8. allowNull: false,
  9. primaryKey: true,
  10. autoIncrement: true,
  11. },
  12. out_batch_no: {
  13. type: DataTypes.STRING(128),
  14. allowNull: true,
  15. },
  16. out_detail_no: {
  17. type: DataTypes.STRING(128),
  18. allowNull: true,
  19. },
  20. batch_id: {
  21. type: DataTypes.STRING(64),
  22. allowNull: true,
  23. },
  24. detail_id: {
  25. type: DataTypes.STRING(64),
  26. allowNull: true,
  27. },
  28. detail_status: {
  29. type: DataTypes.STRING(64),
  30. allowNull: true,
  31. },
  32. fail_reason: {
  33. type: DataTypes.STRING(64),
  34. allowNull: true,
  35. },
  36. batch_name: {
  37. type: DataTypes.STRING(32),
  38. allowNull: true,
  39. },
  40. batch_remark: {
  41. type: DataTypes.STRING(32),
  42. allowNull: true,
  43. },
  44. cash: {
  45. type: DataTypes.FLOAT,
  46. allowNull: true,
  47. },
  48. user_id: {
  49. type: DataTypes.INTEGER(10).UNSIGNED,
  50. allowNull: true,
  51. },
  52. type: {
  53. type: DataTypes.INTEGER(2).UNSIGNED,
  54. allowNull: true,
  55. },
  56. create_time: {
  57. type: DataTypes.TIME,
  58. allowNull: true,
  59. },
  60. update_time: {
  61. type: DataTypes.TIME,
  62. allowNull: true,
  63. },
  64. partner_id: {
  65. type: DataTypes.INTEGER(11),
  66. allowNull: true,
  67. },
  68. }, {
  69. tableName: 'szj_users_cash_logs',
  70. });
  71. Model.associate = function() {
  72. // 关联用户表
  73. Model.belongsTo(app.model.Users, { foreignKey: 'user_id', targetKey: 'user_id', as: 'user' });
  74. };
  75. // 同步:没有就新建,有就不变
  76. Model.sync();
  77. return Model;
  78. };