<?php namespace App\Models;


use Illuminate\Database\Eloquent\Builder;


class Tasks extends Central  {
	
	protected $table = 'tasks';
	protected $primaryKey = 'id';
	public $module = 'tasks';
	
	protected $guarded = [];
	public $timestamps = false;

    protected $casts = ['data' => 'array'];

    protected static function boot()
    {
        parent::boot();
        static::addGlobalScope('active', function (Builder $builder) {
            $egyTime = now()->timezone('Africa/Cairo')->toDateTimeString();
            $builder->whereRaw(" IFNULL(run_at,'{$egyTime}') >= '{$egyTime}'");
        });
    }

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

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

	public static function queryWhere(  ){
		
		return "  WHERE tasks.id IS NOT NULL ";
	}
	
	public static function queryGroup(){
		return "  ";
	}
	

}
