Commit d2ed5477 by 王昆

gsb

parent e78d548f
...@@ -2,12 +2,6 @@ ...@@ -2,12 +2,6 @@
module.exports = function(sequelize, DataTypes) { module.exports = function(sequelize, DataTypes) {
return sequelize.define('taxinfo', { return sequelize.define('taxinfo', {
id: {
type: DataTypes.INTEGER(11),
allowNull: false,
primaryKey: true,
autoIncrement: true
},
name: { name: {
type: DataTypes.STRING(255), type: DataTypes.STRING(255),
allowNull: true allowNull: true
...@@ -28,24 +22,51 @@ module.exports = function(sequelize, DataTypes) { ...@@ -28,24 +22,51 @@ module.exports = function(sequelize, DataTypes) {
type: DataTypes.DATE, type: DataTypes.DATE,
allowNull: true allowNull: true
}, },
created_at: { tax_url: {
type: DataTypes.DATE, type: DataTypes.STRING,
allowNull: true
},
updated_at: {
type: DataTypes.DATE,
allowNull: true
},
deleted_at: {
type: DataTypes.DATE,
allowNull: true allowNull: true
}, },
version: {
type: DataTypes.INTEGER(11),
allowNull: true,
defaultValue: '0'
}
}, { }, {
tableName: 'tax_info' paranoid: true,//假的删除
underscored: true,
version: false,
freezeTableName: true,
//freezeTableName: true,
// define the table's name
tableName: 'tax_info',
validate: {
},
indexes:[
// Create a unique index on email
// {
// unique: true,
// fields: ['email']
// },
//
// // Creates a gin index on data with the jsonb_path_ops operator
// {
// fields: ['data'],
// using: 'gin',
// operator: 'jsonb_path_ops'
// },
//
// // By default index name will be [table]_[fields]
// // Creates a multi column partial index
// {
// name: 'public_by_author',
// fields: ['author', 'status'],
// where: {
// status: 'public'
// }
// },
//
// // A BTREE index with a ordered field
// {
// name: 'title_index',
// method: 'BTREE',
// fields: ['author', {attribute: 'title', collate: 'en_US', order: 'DESC', length: 5}]
// }
]
}); });
}; };
...@@ -27,8 +27,7 @@ class TaxinfoService extends ServiceBase { ...@@ -27,8 +27,7 @@ class TaxinfoService extends ServiceBase {
var orderby = [ var orderby = [
["id", 'desc'] ["id", 'desc']
]; ];
var attributes = [`id`, `company_name`, `name`, `id_no`, `actual_amount`, `income_tax`, `tax_time`, `sign_body`]; var page = await this.getPageList(currentPage, pageSize, where, orderby);
var page = await this.getPageList(currentPage, pageSize, where, orderby, attributes);
if (page && page.rows) { if (page && page.rows) {
for (var row of page.rows) { for (var row of page.rows) {
this.handleDate(row, ["tax_time"]); this.handleDate(row, ["tax_time"]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment