feat: tambah role editor, workflow post, leaderboard, rekap kehadiran, kategori kas dengan type, seeder lengkap
This commit is contained in:
@@ -16,17 +16,17 @@ class MemberPointSeeder extends Seeder
|
||||
Activity::whereNotNull('executed_at')->each(function ($activity) {
|
||||
$activity->participants()->wherePivot('status', 'hadir')->each(function ($user) use ($activity) {
|
||||
MemberPoint::firstOrCreate(
|
||||
['user_id' => $user->id, 'source_type' => 'activity', 'source_id' => $activity->id],
|
||||
['user_id' => $user->id, 'source_type' => Activity::class, 'source_id' => $activity->id],
|
||||
['points' => 10, 'reason' => "Hadir di kegiatan: {$activity->title}"]
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
// Poin dari artikel yang sudah published
|
||||
Post::where('status', 'published')->each(function ($post) {
|
||||
// Poin dari artikel yang sudah approved
|
||||
Post::where('status', 'approved')->orWhere('status', 'published')->each(function ($post) {
|
||||
MemberPoint::firstOrCreate(
|
||||
['user_id' => $post->author_id, 'source_type' => 'post', 'source_id' => $post->id],
|
||||
['points' => 5, 'reason' => "Artikel dipublikasi: {$post->title}"]
|
||||
['user_id' => $post->author_id, 'source_type' => Post::class, 'source_id' => $post->id],
|
||||
['points' => 5, 'reason' => "Artikel disetujui: {$post->title}"]
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user