<?php
namespace Trash;
use Illuminate\Database\Eloquent\Model;
class ReportConfig extends Model
{
//
protected $table = "report_config";
public function mes_orden(){
$year = date('Y');
$sql="SELECT MONTH(fecha_inicio) mes
FROM orden
WHERE YEAR(fecha_inicio) = '$year' AND cancel = 0
GROUP BY MONTH(fecha_inicio) ";
$data = \DB::select( \DB::raw( $sql ));
if(count($data) != null ){
return $data ;
}else{
return false;
}
}
public function year_orden(){
$sql="SELECT YEAR(fecha_inicio) year
FROM orden
WHERE cancel = 0
GROUP BY YEAR(fecha_inicio) ";
$data = \DB::select( \DB::raw( $sql ));
if(count($data) != null ){
return $data ;
}else{
return false;
}
}
}