public static function CheckPreActivation($feasible, $crf)
 {
     if ($feasible == "splicing") {
         $pre_activation = PreActivationStatus::whereIn('crf_no', $crf)->where("{$feasible}", '=', 0)->where('fiber', '=', 1)->where('activation', '=', 0)->get();
     } else {
         if ($feasible == "ethernet") {
             $pre_activation = PreActivationStatus::whereIn('crf_no', $crf)->where("{$feasible}", '=', 0)->where('fiber', '=', 1)->where('splicing', '=', 1)->where('activation', '=', 0)->get();
         } else {
             if ($feasible == "configuration") {
                 $pre_activation = PreActivationStatus::whereIn('crf_no', $crf)->where("{$feasible}", '=', 0)->where('fiber', '=', 1)->where('splicing', '=', 1)->where('ethernet', '=', 1)->where('activation', '=', 0)->get();
             } else {
                 $pre_activation = PreActivationStatus::whereIn('crf_no', $crf)->where("{$feasible}", '=', 0)->where('activation', '=', 0)->get();
             }
         }
     }
     if (count($pre_activation) != 0) {
         foreach ($pre_activation as $key) {
             $crf_no[] = $key->crf_no;
         }
     } else {
         $crf_no = NULL;
     }
     return $crf_no;
 }
Exemple #2
0
 public function feasible()
 {
     $crf_no = CusDet::where('account_id', '=', $this->account_id)->get()->first();
     if ($crf_no) {
         $feasiable = PreActivationStatus::where('crf_no', '=', $crf_no->crf_no)->get()->first();
         return $feasiable;
     }
     return null;
 }