1234567891011121314151617181920212223242526272829303132333435363738394041 |
- import { CoolController, BaseController } from '@cool-midway/core';
- import {
- ALL,
- Body,
- Get,
- Inject,
- Param,
- Post,
- Provide,
- Query,
- } from '@midwayjs/decorator';
- import { Context } from '@midwayjs/koa';
- import {OpenPayeeService} from "../../service/admin/OpenPayee";
- import {OpenProfitEntity} from "../../entity/open_profit";
- import {openProfitService} from "../../service/admin/OpenProfit";
- /**
- * 收款人
- */
- @Provide()
- @CoolController({
- api: ['add', 'delete', 'update', 'info', 'page', 'list'],
- entity: OpenProfitEntity,
- service: openProfitService,
- pageQueryOp: {
- where: async (ctx: Context) => {
- const { merchant, roleIds } = ctx.admin;
- if (roleIds.includes(1) || roleIds.includes(3)) {
- return [['mch_id=:mch_id', { mch_id: merchant.mch_id }]];
- }
- return [];
- },
- },
- })
- export class openProfitController extends BaseController {
- @Inject()
- openProfitService: openProfitService;
- @Inject()
- ctx: Context;
- }
|