明树Git Lab

Commit 53f4afe2 authored by zfp1's avatar zfp1

update

parent d8d782be
......@@ -230,13 +230,17 @@ async function listUser(req, res, next) {
let limit = req.body.pageSize || 10;
let offset = (page - 1) * limit;
if (req.body.name) {
search.where = {
[Op.or]: [
{ name: { [Op.like]: `%${req.body.name}%` } },
{ mobile: { [Op.like]: `%${req.body.name}%` } }
],
del: 0,
}
// search.where = {
// [Op.or]: [
// { name: { [Op.like]: `%${req.body.name}%` } },
// { mobile: { [Op.like]: `%${req.body.name}%` } }
// ],
// del: 0,
// }
search.where.name ={ [Op.like]: `%${req.body.name}%` }
}
if (req.body.mobile) {
search.where.mobile = { [Op.like]: `%${req.body.name}%` }
}
search.limit = limit;
search.offset = offset;
......
......@@ -13,10 +13,6 @@ const Resources = sequelize.define('Resources', {
type: DataTypes.STRING,
comment: "资源库key"
},
parentkey: {
type: DataTypes.STRING,
comment: "资源库key"
},
name: {
type: DataTypes.STRING,
comment: "资源库名称"
......@@ -60,9 +56,9 @@ const Resources = sequelize.define('Resources', {
// 同步模型到数据库(创建表)
Resources.sync({
force: false,
// force: false,
// force: true ,//会删除已存在表并重新创建
// alter: true
alter: true
})
.then(() => {
console.log('Resources 表同步成功');
......
......@@ -13,6 +13,10 @@ const ResourcesInfo = sequelize.define('ResourcesInfo', {
type: DataTypes.STRING,
comment: "资源库字段key"
},
parentkey: {
type: DataTypes.STRING,
comment: "资源库key"
},
value: {
type: DataTypes.STRING,
comment: "资源库字段value"
......
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