29 lines
648 B
PHP
29 lines
648 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Support\Facades\DB;
|
|
|
|
class AlternatifModel extends Model
|
|
{
|
|
protected $table = 'alternatif';
|
|
protected $primaryKey = 'id_alternatif';
|
|
protected $fillable = ['nama', 'jenis_kelamin', 'divisi'];
|
|
public $timestamps = false;
|
|
|
|
public static function get_alternatif($j)
|
|
{
|
|
return DB::table('alternatif')
|
|
->where('jenis_kelamin', $j)
|
|
->paginate(10);
|
|
}
|
|
|
|
public static function get_rangking($j)
|
|
{
|
|
return DB::table('alternatif')
|
|
->where('jenis_kelamin', $j)
|
|
->get();
|
|
}
|
|
}
|