Commit 343c3cb5 authored by 姜登's avatar 姜登

user判断

parent 3ecb44c6
Pipeline #8977 passed with stage
in 3 seconds
......@@ -41,6 +41,7 @@ class PriceController extends Controller {
async index() {
const { ctx, service } = this;
ctx.validate(this.indexRule, ctx.query);
await service.user.getUserInfo();
const ret = await service.userDetail.findAll(this.model, { appkey: ctx.query.appKey }, ['pay_type', 'price', 'start_time', 'end_time', 'operator'], ctx.pagination);
const total = await service.userDetail.count(this.model, { appkey: ctx.query.appKey });
ctx.success({ data: ret, total, ...ctx.pagination });
......
......@@ -32,6 +32,7 @@ class RemissionController extends Controller {
async index() {
const { ctx, service } = this;
ctx.validate(this.indexRule, ctx.query);
await service.user.getUserInfo();
const ret = await service.userDetail.findAll(this.model, { appkey: ctx.query.appKey }, ['appkey', 'start_time', 'count', 'operator'], ctx.pagination);
const total = await service.userDetail.count(this.model, { appkey: ctx.query.appKey });
ctx.success({ data: ret, total, ...ctx.pagination });
......
......@@ -74,6 +74,7 @@ class UserController extends Controller {
async update() {
const { ctx, service } = this;
ctx.validate(this.updateRule, ctx.request.body);
await service.user.getUserInfo();
const { id } = ctx.params;
const { status } = ctx.request.body;
await service.user.update({ user_id: id }, { status });
......@@ -83,6 +84,7 @@ class UserController extends Controller {
async serviceList() {
const { ctx, service } = this;
ctx.validate(this.serviceRule, ctx.query);
await service.user.getUserInfo();
const { user_id } = ctx.query;
const ret = await service.user.serviceList({ user_id });
ctx.success(ret);
......
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