<?php namespace App\Models;

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

class sinistersat extends Sximo  {
	
	protected $table = 'at_sinisters_at';
	protected $primaryKey = 'id';

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

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

	public static function queryWhere(  ){
		
		if(session('gid') == 4)
			return " WHERE at_sinisters_at.id IS NOT NULL AND at_sinisters_at.account_id ='".session('aid')."'";
		elseif (session('gid') == 5)
			return " WHERE at_sinisters_at.id IS NOT NULL AND at_sinisters_at.account_id ='".session('aid')."' AND at_sinisters_at.sub_account_id ='".session('sai')."'";
		elseif (session('gid') == 6)
			return " WHERE at_sinisters_at.id IS NOT NULL AND at_sinisters_at.account_id ='".session('aid')."' AND at_sinisters_at.sub_account_id ='".session('sai')."' AND at_sinisters_at.department_id ='".session('did')."'";
		else
			return " WHERE at_sinisters_at.id IS NOT NULL ";
	}
	
	public static function queryGroup(){
		return "  ";
	}
	

}
