public function run()
 {
     $faker = Faker::create();
     foreach (range(1, 100) as $index) {
         ReporteGerencial::create(['MESREGIST' => $faker->randomElement(static::$MESREGIST), 'D_REG' => $faker->randomElement($min = '1', $max = '30'), 'EQUIPO' => $faker->randomElement(static::$EQUIPO), 'CODOPERAC' => $faker->numberBetween($min = '1', $max = '2'), 'CODESTADO' => $faker->numberBetween($min = '0', $max = '3'), 'MESRESOL' => $faker->randomElement(static::$MESREGIST), 'D_RES' => $faker->numberBetween($min = '1', $max = '30')]);
     }
 }
 public function TCAprobadas($MESREGIST, $id)
 {
     return ReporteGerencial::select('CANALVTA2', \DB::raw('count(idRG_TC_IT) as TCAPROBADAS'))->where('MESREGIST', '=', $MESREGIST)->groupBy('CANALVTA2')->get();
 }