Commit 3fcb759b by wkliang

debug and fix eslint

parent f5327f8b
...@@ -3,7 +3,7 @@ var system = require("../../../system"); ...@@ -3,7 +3,7 @@ var system = require("../../../system");
class AskForAPI extends APIBase { class AskForAPI extends APIBase {
constructor() { constructor() {
super(); super();
this.askForSve = system.getObject("service.askfor.AskForSve"); this.askForSve = system.getObject("service.askfor.askForSve");
} }
async tradeMark (pobj, qobj, req) { async tradeMark (pobj, qobj, req) {
...@@ -16,7 +16,7 @@ class AskForAPI extends APIBase { ...@@ -16,7 +16,7 @@ class AskForAPI extends APIBase {
let result let result
switch (pobj.actionType) { switch (pobj.actionType) {
case "getByUid": 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) return system.getResult2(result)
case 'create': case 'create':
let param = {} let param = {}
......
...@@ -16,9 +16,9 @@ class CollectAPI extends APIBase { ...@@ -16,9 +16,9 @@ class CollectAPI extends APIBase {
let result let result
switch (pobj.actionType) { switch (pobj.actionType) {
case 'getByUid': 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) return system.getResult2(result)
case 'getByUidAndCollections': case 'getByUidAndCollections':
result = await this.collectSve.getByUidAndCollections(pobj.userInfo.id, pobj.actionBody.collections) result = await this.collectSve.getByUidAndCollections(pobj.userInfo.id, pobj.actionBody.collections)
return system.getResult2(result) return system.getResult2(result)
......
const Dao=require("../../dao.base"); const Dao = require("../../dao.base");
class AskForDao extends Dao { class AskForDao extends Dao {
constructor(){ constructor() {
super(Dao.getModelName(AskForDao)); super(Dao.getModelName(AskForDao));
} }
async getByUid (uid, page = 1) { async getByUid (uid, page = 1, offset = 11) {
return await this.model.findAndCountAll({ return await this.model.findAndCountAll({
where: {user_id: uid, a_type: 1}, where: { user_id: uid, a_type: 1 },
limit: 11, limit: 11,
offset: (page - 1) * 11 offset: (page - 1) * offset
}) })
} }
...@@ -17,9 +17,11 @@ class AskForDao extends Dao { ...@@ -17,9 +17,11 @@ class AskForDao extends Dao {
} }
async delete (id) { async delete (id) {
return await this.model.destroy({where:{ return await this.model.destroy({
id:id where: {
}}) id: id
}
})
} }
} }
module.exports = AskForDao; module.exports = AskForDao;
\ No newline at end of file
const Dao=require("../../dao.base"); const Dao = require("../../dao.base");
class CollectDao extends Dao { class CollectDao extends Dao {
constructor(){ constructor() {
super(Dao.getModelName(CollectDao)); super(Dao.getModelName(CollectDao));
} }
async getByUid (uid, page = 1) { async getByUid (uid, page = 1, offset = 12) {
return await this.model.findAndCountAll({ return await this.model.findAndCountAll({
where: {user_id: uid, c_type: 1}, where: { user_id: uid, c_type: 1 },
limit: 9, limit: 9,
offset: (page - 1) * 9 offset: (page - 1) * offset
}) })
} }
...@@ -31,9 +31,11 @@ class CollectDao extends Dao { ...@@ -31,9 +31,11 @@ class CollectDao extends Dao {
} }
async delete (id) { async delete (id) {
return await this.model.destroy({where:{ return await this.model.destroy({
id:id where: {
}}) id: id
}
})
} }
} }
module.exports = CollectDao; module.exports = CollectDao;
\ No newline at end of file
...@@ -4,8 +4,8 @@ class AskForService extends ServiceBase { ...@@ -4,8 +4,8 @@ class AskForService extends ServiceBase {
super("askfor", ServiceBase.getDaoName(AskForService)); super("askfor", ServiceBase.getDaoName(AskForService));
} }
async getByUid (uid, page = 1) { async getByUid (uid, page = 1, offset = 11) {
return await this.dao.getByUid(uid, page); return await this.dao.getByUid(uid, page, offset);
} }
async create (param) { async create (param) {
......
...@@ -4,8 +4,8 @@ class CollectService extends ServiceBase { ...@@ -4,8 +4,8 @@ class CollectService extends ServiceBase {
super("askfor", ServiceBase.getDaoName(CollectService)); super("askfor", ServiceBase.getDaoName(CollectService));
} }
async getByUid (uid, page = 1) { async getByUid (uid, page = 1, offset = 12) {
return await this.dao.getByUid(uid, page); return await this.dao.getByUid(uid, page, offset);
} }
async getByUidAndCollections (uid, collections) { async getByUidAndCollections (uid, collections) {
......
示例:----------------------------------开始-------------------------------------------------------------------- 示例:----------------------------------开始--------------------------------------------------------------------
...@@ -105,4 +105,7 @@ CREATE TABLE `c_collect` ( ...@@ -105,4 +105,7 @@ CREATE TABLE `c_collect` (
PRIMARY KEY (`id`) USING BTREE PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic; ) 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