add
This commit is contained in:
parent
a7c82b66f8
commit
f8f3e7985e
|
@ -40,7 +40,11 @@ export class VisitService extends BaseService<Prisma.VisitDelegate> {
|
||||||
id: postId,
|
id: postId,
|
||||||
visitType: args.data.type, // 直接复用传入的类型
|
visitType: args.data.type, // 直接复用传入的类型
|
||||||
});
|
});
|
||||||
|
EventBus.emit('updateTotalCourseViewCount', {
|
||||||
|
visitType: args.data.type, // 直接复用传入的类型
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
async createMany(args: Prisma.VisitCreateManyArgs, staff?: UserProfile) {
|
async createMany(args: Prisma.VisitCreateManyArgs, staff?: UserProfile) {
|
||||||
|
@ -138,6 +142,9 @@ export class VisitService extends BaseService<Prisma.VisitDelegate> {
|
||||||
id: args?.where?.postId as string,
|
id: args?.where?.postId as string,
|
||||||
visitType: args.where.type as any, // 直接复用传入的类型
|
visitType: args.where.type as any, // 直接复用传入的类型
|
||||||
});
|
});
|
||||||
|
EventBus.emit('updateTotalCourseViewCount', {
|
||||||
|
visitType: args.where.type as any, // 直接复用传入的类型
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return superDetele;
|
return superDetele;
|
||||||
|
|
|
@ -38,7 +38,7 @@ export async function updateTotalCourseViewCount(type: VisitType) {
|
||||||
data: {
|
data: {
|
||||||
meta: {
|
meta: {
|
||||||
...baseSeting,
|
...baseSeting,
|
||||||
reads: totalViews,
|
reads: totalViews._sum.views,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
|
import React from "react";
|
||||||
export interface MenuItemType {
|
export interface MenuItemType {
|
||||||
icon: JSX.Element;
|
icon: React.;
|
||||||
label: string;
|
label: string;
|
||||||
action: () => void;
|
action: () => void;
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,7 +47,7 @@ export const CourseDetailDescription: React.FC = () => {
|
||||||
<div>{course?.subTitle}</div>
|
<div>{course?.subTitle}</div>
|
||||||
<div className="flex gap-1">
|
<div className="flex gap-1">
|
||||||
<EyeOutlined></EyeOutlined>
|
<EyeOutlined></EyeOutlined>
|
||||||
<div>{course?.meta?.views}</div>
|
<div>{course?.meta?.views || 0}</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex gap-1">
|
<div className="flex gap-1">
|
||||||
<CalendarOutlined></CalendarOutlined>
|
<CalendarOutlined></CalendarOutlined>
|
||||||
|
|
|
@ -21,7 +21,7 @@ export function CourseDetailHeader() {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Header className="select-none flex items-center justify-center bg-white shadow-md border-b border-gray-100 fixed w-full z-30">
|
<Header className="select-none flex items-center justify-center bg-white shadow-md border-b border-gray-100 fixed w-full z-30">
|
||||||
<div className="w-full max-w-screen-2xl px-4 md:px-6 mx-auto flex items-center justify-between h-full">
|
<div className="w-full flex items-center justify-between h-full">
|
||||||
<div className="flex items-center space-x-2">
|
<div className="flex items-center space-x-2">
|
||||||
<HomeOutlined
|
<HomeOutlined
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
|
Loading…
Reference in New Issue