view_order_commission.js 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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('ViewOrderCommission', {
  6. commission: {
  7. type: DataTypes.FLOAT,
  8. allowNull: true,
  9. },
  10. surplusAmout: {
  11. type: DataTypes.INTEGER(10),
  12. allowNull: true,
  13. },
  14. orderAmount: {
  15. type: DataTypes.INTEGER(10),
  16. allowNull: true,
  17. },
  18. orderNum: {
  19. type: DataTypes.STRING(255),
  20. allowNull: true,
  21. },
  22. orderUser: {
  23. type: DataTypes.STRING(255),
  24. allowNull: true,
  25. },
  26. inviterUser: {
  27. type: DataTypes.STRING(255),
  28. allowNull: true,
  29. },
  30. orderTime: {
  31. type: DataTypes.TIME,
  32. allowNull: true,
  33. },
  34. }, {
  35. tableName: 'view_order_commission',
  36. });
  37. Model.associate = function() {
  38. // Model.belongsTo(app.model.AdminUser, { foreignKey: 'admin_id', targetKey: 'admin_id', as: 'admin_user' });
  39. };
  40. // 同步:没有就新建,有就不变
  41. Model.sync();
  42. return Model;
  43. };