## Deskripsi:
- Cek notif
## No Issue
This commit is contained in:
2024-08-26 17:18:09 +08:00
parent a6bb993b0d
commit 916c5c7d85
183 changed files with 720 additions and 584 deletions

View File

@@ -3,7 +3,10 @@
import prisma from "@/app/lib/prisma";
import moment from "moment";
export async function investasi_funGetAllPublish() {
export async function investasi_funGetAllPublish({ page }: { page: number }) {
const takeData = 5;
const skipData = page * takeData - takeData;
const data = await prisma.investasi.findMany({
where: {
masterStatusInvestasiId: "1",
@@ -23,8 +26,6 @@ export async function investasi_funGetAllPublish() {
moment(new Date()).diff(new Date(a.countDown as any), "days") <=
0
) {
// console.log(a.MasterPencarianInvestor?.name);
await prisma.investasi.update({
where: {
id: a.id,
@@ -51,34 +52,25 @@ export async function investasi_funGetAllPublish() {
// klo ada, update status
const dataFix = await prisma.investasi.findMany({
take: takeData,
skip: skipData,
orderBy: [
{
masterProgresInvestasiId: "asc",
},
{
countDown: "desc",
},
],
where: {
masterStatusInvestasiId: "1",
},
select: {
id: true,
title: true,
authorId: true,
hargaLembar: true,
targetDana: true,
totalLembar: true,
sisaLembar: true,
progress: true,
roi: true,
active: true,
createdAt: true,
updatedAt: true,
imagesId: true,
include: {
ProspektusInvestasi: true,
MasterPembagianDeviden: true,
MasterPencarianInvestor: true,
MasterPeriodeDeviden: true,
MasterProgresInvestasi: true,
countDown: true,
},
});

View File

@@ -6,7 +6,7 @@ export default async function getNorekInvestasi(id: string) {
const res = await prisma.masterBank.findUnique({
where: { id: id },
select: {
name: true,
namaBank: true,
norek: true,
},
});