feat(goods): add editable custom products
This commit is contained in:
@@ -67,9 +67,12 @@ export class OriginGoodsService {
|
||||
|
||||
async findAll(query: QueryOriginGoodDto): Promise<PaginatedOriginGoods> {
|
||||
const { page, pageSize, keyword } = query;
|
||||
const where: Prisma.OriginGoodWhereInput = keyword
|
||||
? { goodName: { contains: keyword, mode: 'insensitive' } }
|
||||
: {};
|
||||
const where: Prisma.OriginGoodWhereInput = {
|
||||
source: 'SDS',
|
||||
...(keyword
|
||||
? { goodName: { contains: keyword, mode: 'insensitive' as const } }
|
||||
: {}),
|
||||
};
|
||||
|
||||
const [total, rows] = await this.prisma.$transaction([
|
||||
this.prisma.originGood.count({ where }),
|
||||
@@ -124,7 +127,7 @@ export class OriginGoodsService {
|
||||
},
|
||||
}),
|
||||
this.prisma.originGood.findMany({
|
||||
where: { delisted: false },
|
||||
where: { delisted: false, source: 'SDS' },
|
||||
orderBy: { goodName: 'asc' },
|
||||
include: { detail: true, _count: { select: { variants: true } } },
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user