<?php namespace App\Models;

use Illuminate\Auth\Authenticatable;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Auth;

class reportegastosusuario extends Sximo  {
	
	protected $table = 'reportes';
	protected $primaryKey = 'ReportesID';

	public function __construct() {
		parent::__construct();
		
	}

	public static function querySelect(  ){
		
		return "  SELECT reportes.* FROM reportes  ";
	}	

	public static function queryWhere(  ){
	    $id = Auth::id();
	    	$dbcon = 0;
		$sql = \DB::table('tb_users')->where('id',$id)->get();
		if(count($sql)){
			$row = $sql[0];
			$Condominio =$row->Condominio;
		}	
	    
		
		return " WHERE reportes.ReportesID IS NOT NULL AND reportes.Tipo ='GASTO' AND reportes.Condominio='$Condominio'";
	}
	
	public static function queryGroup(){
		return "  ";
	}
	

}
