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 { ...@@ -41,6 +41,7 @@ class PriceController extends Controller {
async index() { async index() {
const { ctx, service } = this; const { ctx, service } = this;
ctx.validate(this.indexRule, ctx.query); 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 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 }); const total = await service.userDetail.count(this.model, { appkey: ctx.query.appKey });
ctx.success({ data: ret, total, ...ctx.pagination }); ctx.success({ data: ret, total, ...ctx.pagination });
......
...@@ -32,6 +32,7 @@ class RemissionController extends Controller { ...@@ -32,6 +32,7 @@ class RemissionController extends Controller {
async index() { async index() {
const { ctx, service } = this; const { ctx, service } = this;
ctx.validate(this.indexRule, ctx.query); 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 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 }); const total = await service.userDetail.count(this.model, { appkey: ctx.query.appKey });
ctx.success({ data: ret, total, ...ctx.pagination }); ctx.success({ data: ret, total, ...ctx.pagination });
......
...@@ -74,6 +74,7 @@ class UserController extends Controller { ...@@ -74,6 +74,7 @@ class UserController extends Controller {
async update() { async update() {
const { ctx, service } = this; const { ctx, service } = this;
ctx.validate(this.updateRule, ctx.request.body); ctx.validate(this.updateRule, ctx.request.body);
await service.user.getUserInfo();
const { id } = ctx.params; const { id } = ctx.params;
const { status } = ctx.request.body; const { status } = ctx.request.body;
await service.user.update({ user_id: id }, { status }); await service.user.update({ user_id: id }, { status });
...@@ -83,6 +84,7 @@ class UserController extends Controller { ...@@ -83,6 +84,7 @@ class UserController extends Controller {
async serviceList() { async serviceList() {
const { ctx, service } = this; const { ctx, service } = this;
ctx.validate(this.serviceRule, ctx.query); ctx.validate(this.serviceRule, ctx.query);
await service.user.getUserInfo();
const { user_id } = ctx.query; const { user_id } = ctx.query;
const ret = await service.user.serviceList({ user_id }); const ret = await service.user.serviceList({ user_id });
ctx.success(ret); 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