Commit d768840b by wkliang

page 分转元

parent 511ea731
......@@ -33,13 +33,7 @@ class ActionAPI extends APIBase {
let result
switch (action_type) {
case 'getPage':
if (!action_body.types) {
delete action_body.types
}
if (action_body.keywords == null || action_body.keywords == "") {
delete action_body.keywords
}
result = await this.productSve.getPage(Number(action_body.page), Number(action_body.limit),
result = await this.productSve.getPage(action_body.page, action_body.limit,
action_body.types, action_body.keywords)
break
case 'createOrUpdate':
......
......@@ -7,7 +7,14 @@ class ProductService extends ServiceBase {
}
async getPage (page, limit, type, keywords) {
return await this.dao.getPage(page, limit, type, keywords)
let result = await this.dao.getPage(page, limit, type, keywords)
for (let i = 0; i < result.rows.length; ++i) {
console.log(result[i])
if (result.rows[i].price) {
result.rows[i].setDataValue("price", result.rows[i].price / 100)
}
}
return result
}
async getAllDic (type = [1, 2]) {
......
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