Revisi Admin Investasi

# fix:
- Perbaharui tampilan
### No issue
This commit is contained in:
2023-12-05 17:09:07 +08:00
parent 089010d2e8
commit 265a869946
16 changed files with 551 additions and 227 deletions

View File

@@ -1,36 +1,39 @@
"use server"
"use server";
import prisma from "@/app/lib/prisma"
import prisma from "@/app/lib/prisma";
export default async function Admin_funGetAllInvestasi() {
const res = await prisma.investasi.findMany({
where: {
MasterStatusInvestasi: {
name: {
not: "Draft"
}
}
const res = await prisma.investasi.findMany({
where: {
MasterStatusInvestasi: {
name: {
not: "Draft",
},
select: {
id: true,
title: true,
authorId: true,
hargaLembar: true,
targetDana: true,
totalLembar: true,
roi: true,
active: true,
imagesId: true,
catatan: true,
MasterStatusInvestasi: true,
BeritaInvestasi: true,
DokumenInvestasi: true,
ProspektusInvestasi: true,
MasterPembagianDeviden: true,
MasterPencarianInvestor: true,
MasterPeriodeDeviden: true,
},
})
// console.log(res)
return res
}
},
},
select: {
id: true,
title: true,
authorId: true,
hargaLembar: true,
targetDana: true,
totalLembar: true,
roi: true,
active: true,
imagesId: true,
catatan: true,
MasterStatusInvestasi: true,
BeritaInvestasi: true,
DokumenInvestasi: true,
ProspektusInvestasi: true,
MasterPembagianDeviden: true,
MasterPencarianInvestor: true,
MasterPeriodeDeviden: true,
author: true,
progress: true,
sisaLembar: true
},
});
// console.log(res)
return res;
}

View File

@@ -3,20 +3,31 @@
import prisma from "@/app/lib/prisma";
import _ from "lodash";
export default async function Admin_getTargetTerbesarInvestasi() {
export default async function Admin_getPublishProgresInvestasi() {
const data = await prisma.investasi.findMany({
orderBy: {
targetDana: "desc",
updatedAt: "desc"
},
where: {
MasterStatusInvestasi: {
name: "Publish",
},
},
select: {
id: true,
author: {
select: {
username: true,
},
},
updatedAt: true,
targetDana: true,
progress: true,
},
});
// console.log(data)
// console.log(data)
return data;
}