1
This commit is contained in:
@@ -1,18 +1,19 @@
|
||||
const crud = require("../service/biz_admin_crud");
|
||||
|
||||
const baseModel = require("../../middleware/baseModel");
|
||||
const { find_page, find_for_export } = require("../service/biz_query_helpers");
|
||||
const logic = require("../service/biz_subscription_logic");
|
||||
const audit = require("../service/biz_audit_service");
|
||||
|
||||
module.exports = {
|
||||
"POST /biz_subscription/page": async (ctx) => {
|
||||
const body = ctx.getBody();
|
||||
const data = await crud.page("biz_subscription", body);
|
||||
ctx.success({ rows: data.rows, count: data.count });
|
||||
const { count, rows } = await find_page(baseModel.biz_subscription, "biz_subscription", body);
|
||||
ctx.success({ rows, count });
|
||||
},
|
||||
"GET /biz_subscription/detail": async (ctx) => {
|
||||
const q = ctx.query || {};
|
||||
const row = await crud.detail("biz_subscription", { id: q.id || q.ID });
|
||||
const id = q.id || q.ID;
|
||||
if (id === undefined || id === null || id === "") throw new Error("缺少 id");
|
||||
const row = await baseModel.biz_subscription.findByPk(id);
|
||||
ctx.success(row);
|
||||
},
|
||||
"GET /biz_subscription/by_user": async (ctx) => {
|
||||
@@ -74,7 +75,7 @@ module.exports = {
|
||||
},
|
||||
"POST /biz_subscription/export": async (ctx) => {
|
||||
const body = ctx.getBody();
|
||||
const res = await crud.exportCsv("biz_subscription", body);
|
||||
const res = await find_for_export(baseModel.biz_subscription, "biz_subscription", body);
|
||||
ctx.success(res);
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user