app/TermRelation.php
/*
   * Get District/formation Units Terms
   */
Get District/formation Units Terms
Get District / formation Units Terms
public static function retrieveCentralDistrictTerms($user_id){
        if(!$user_id)
            return null;
        $centralTerms = self::where('user_id',$user_id)->first();
        $centralDistrictTerms = self::where(
            [
                'district_office_id'=>$centralTerms->central_office_id,
                'term_type'=>0,
                'role'=> 2
            ]
        )->where('user_id','!=',$user_id)->get();
        return $centralDistrictTerms;
    }
public static function retrieveCentralDistrictTerms ( $ user_id ) { if ( ! $ user_id ) return null ; $ centralTerms = self :: where ( 'user_id' , $ user_id ) -> first ( ) ; $ centralDistrictTerms = self :: where ( [ 'district_office_id' => $ centralTerms -> central_office_id , 'term_type' => 0 , 'role' => 2 ] ) -> where ( 'user_id' , '!=' , $ user_id ) -> get ( ) ; return $ centralDistrictTerms ; }
Get District/formation Units Terms
Get District / formation Units Terms