<?php

use Google\Service\CloudSearch\Resource\Query;

defined('BASEPATH') or exit('No direct script access allowed');

class Notifikasi_arisan extends CI_Model
{
    public function vd_anggota_arisanheboh()
    {
        $query = $this->db->select('*');
        $query = $this->db->from('p_arisan_anggota as A');
        $query = $this->db->join('anggota as B', 'A.anggota_id=B.id');
        $query = $this->db->join('p_arisan as C', 'A.regist_arisan=C.id');
        $query = $this->db->join('p_arisan_jadwal as D', 'A.regist_arisan=D.regist_arisan');
        $query = $this->db->where('C.produk_id', '21');
        $query = $this->db->where('A.status', 'AKTIF');
        $query = $this->db->where('D.status_undian', 'BELUM');
        $query = $this->db->group_by('A.anggota_id', 'ASC');
        $query = $this->db->get();
        return $query->result();
    }
    public function vd_anggota_arisanmotor()
    {
        $query = $this->db->select('*');
        $query = $this->db->from('p_arisan_anggota as A');
        $query = $this->db->join('anggota as B', 'A.anggota_id=B.id');
        $query = $this->db->join('p_arisan as C', 'A.regist_arisan=C.id');
        $query = $this->db->join('p_arisan_jadwal as D', 'A.regist_arisan=D.regist_arisan');
        $query = $this->db->where('C.produk_id', '22');
        $query = $this->db->where('D.status_undian', 'BELUM');
        $query = $this->db->get();
        return $query->result();
    }
    public function Notifikasi_pengajuan()
    {
        $this->db->select('*');
        $this->db->from('p_arisan_pengajuan');
        $query = $this->db->get();
        return $query->result();
    }
}