Commit b7830e60 by 王昆

gsb

parent e910ed9f
...@@ -96,6 +96,9 @@ class ActionAPI extends APIBase { ...@@ -96,6 +96,9 @@ class ActionAPI extends APIBase {
case "deliverAll": case "deliverAll":
opResult = await this.deliverSve.apiAll(action_body); opResult = await this.deliverSve.apiAll(action_body);
break; break;
case "channelDics":
opResult = await this.deliverSve.channelDics(action_body);
break;
case "deliverPage": case "deliverPage":
opResult = await this.deliverSve.apiPage(action_body); opResult = await this.deliverSve.apiPage(action_body);
break; break;
......
...@@ -20,6 +20,19 @@ class DeliverDao extends Dao { ...@@ -20,6 +20,19 @@ class DeliverDao extends Dao {
return await this.customQuery(sql.join(" "),params) || []; return await this.customQuery(sql.join(" "),params) || [];
} }
async channelDics(channel_id) {
let sql = [];
sql.push("SELECT");
sql.push("t1.id, t1.name");
sql.push("FROM `d_deliver_channel` t2");
sql.push("INNER JOIN `d_deliver` t1 ON t2.`deliver_id` = t1.`id`");
sql.push("WHERE channel_id = :channel_id");
sql.push("ORDER BY t1.created_at ASC");
return await this.customQuery(sql.join(" "), {
channel_id: channel_id
}) || [];
}
async delById(id, t) { async delById(id, t) {
var sql = "DELETE FROM d_deliver WHERE id = :id"; var sql = "DELETE FROM d_deliver WHERE id = :id";
return await this.customUpdate(sql, { return await this.customUpdate(sql, {
......
...@@ -201,6 +201,15 @@ class DeliverService extends ServiceBase { ...@@ -201,6 +201,15 @@ class DeliverService extends ServiceBase {
return system.getResultSuccess(list); return system.getResultSuccess(list);
} }
async channelDics(params) {
if (!params.channel_id) {
return system.getResultSuccess([]);
}
let rs = await this.dao.channelDics(params.channel_id);
return system.getResultSuccess(rs);
}
async delById(id) { async delById(id) {
if (!id) { if (!id) {
return system.getResult(null, "删除失败"); return system.getResult(null, "删除失败");
......
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