Commit 3fcb759b by wkliang

debug and fix eslint

parent f5327f8b
......@@ -3,7 +3,7 @@ var system = require("../../../system");
class AskForAPI extends APIBase {
constructor() {
super();
this.askForSve = system.getObject("service.askfor.AskForSve");
this.askForSve = system.getObject("service.askfor.askForSve");
}
async tradeMark (pobj, qobj, req) {
......@@ -16,7 +16,7 @@ class AskForAPI extends APIBase {
let result
switch (pobj.actionType) {
case "getByUid":
result = await this.askForSve.getByUid(pobj.userInfo.id, pobj.actionBody.page)
result = await this.askForSve.getByUid(pobj.userInfo.id, pobj.actionBody.page, pobj.actionBody.offset)
return system.getResult2(result)
case 'create':
let param = {}
......
......@@ -16,9 +16,9 @@ class CollectAPI extends APIBase {
let result
switch (pobj.actionType) {
case 'getByUid':
result = await this.collectSve.getByUid(pobj.userInfo.id, pobj.actionBody.page)
result = await this.collectSve.getByUid(pobj.userInfo.id, pobj.actionBody.page, pobj.actionBody.offset)
return system.getResult2(result)
case 'getByUidAndCollections':
result = await this.collectSve.getByUidAndCollections(pobj.userInfo.id, pobj.actionBody.collections)
return system.getResult2(result)
......
const Dao=require("../../dao.base");
const Dao = require("../../dao.base");
class AskForDao extends Dao {
constructor(){
constructor() {
super(Dao.getModelName(AskForDao));
}
async getByUid (uid, page = 1) {
async getByUid (uid, page = 1, offset = 11) {
return await this.model.findAndCountAll({
where: {user_id: uid, a_type: 1},
where: { user_id: uid, a_type: 1 },
limit: 11,
offset: (page - 1) * 11
offset: (page - 1) * offset
})
}
......@@ -17,9 +17,11 @@ class AskForDao extends Dao {
}
async delete (id) {
return await this.model.destroy({where:{
id:id
}})
return await this.model.destroy({
where: {
id: id
}
})
}
}
module.exports = AskForDao;
\ No newline at end of file
const Dao=require("../../dao.base");
const Dao = require("../../dao.base");
class CollectDao extends Dao {
constructor(){
constructor() {
super(Dao.getModelName(CollectDao));
}
async getByUid (uid, page = 1) {
async getByUid (uid, page = 1, offset = 12) {
return await this.model.findAndCountAll({
where: {user_id: uid, c_type: 1},
where: { user_id: uid, c_type: 1 },
limit: 9,
offset: (page - 1) * 9
offset: (page - 1) * offset
})
}
......@@ -31,9 +31,11 @@ class CollectDao extends Dao {
}
async delete (id) {
return await this.model.destroy({where:{
id:id
}})
return await this.model.destroy({
where: {
id: id
}
})
}
}
module.exports = CollectDao;
\ No newline at end of file
......@@ -4,8 +4,8 @@ class AskForService extends ServiceBase {
super("askfor", ServiceBase.getDaoName(AskForService));
}
async getByUid (uid, page = 1) {
return await this.dao.getByUid(uid, page);
async getByUid (uid, page = 1, offset = 11) {
return await this.dao.getByUid(uid, page, offset);
}
async create (param) {
......
......@@ -4,8 +4,8 @@ class CollectService extends ServiceBase {
super("askfor", ServiceBase.getDaoName(CollectService));
}
async getByUid (uid, page = 1) {
return await this.dao.getByUid(uid, page);
async getByUid (uid, page = 1, offset = 12) {
return await this.dao.getByUid(uid, page, offset);
}
async getByUidAndCollections (uid, collections) {
......
示例:----------------------------------开始--------------------------------------------------------------------
示例:----------------------------------开始--------------------------------------------------------------------
......@@ -105,4 +105,7 @@ CREATE TABLE `c_collect` (
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
INSERT INTO `center_app`.`p_product_type`(`id`, `uapp_id`, `p_id`, `type_code`, `type_name`, `channel_type_code`, `channel_type_name`, `type_pic`, `type_desc`, `type_icon`, `is_enabled`, `created_at`, `updated_at`, `deleted_at`, `version`) VALUES (52, 22, 20, 'sbqm', '商标起名', 'sbqm', '商标起名', NULL, NULL, NULL, 1, '2020-06-24 10:31:33', '2020-06-24 10:31:37', NULL, 0);
----------------------------------结束--------------------------------------------------------------------
\ No newline at end of file
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