Kanchan186
1 week ago

Illuminate \ Database \ QueryException (42S22) SQLSTATE[42S22]: Column not found: 1054 Unknown column 'distributor_other_infos.dist.dist_company_ho' in 'on clause' (SQL: select * from `distributor_other_infos` inner join `head_offices` on `distributor_oth

Posted 1 week ago by Kanchan186

view(EditDistributor_HeadOffice)

 <div class="form-group">
                                        <h5>Select Distributor Head Office <span class="text-danger">*</span></h5>
                                        <div class="controls">
                                            
                                             <select class="form-control"  name="dist_company_ho"   required>
                                                @foreach($HeadOffice as $br)
                                            
                                                @if($br->head_office_id == $HeadOffice->dist_company_ho )
                                                     <option value="{{$br->head_office_id}}" selected >{{$br->head_office_name}}</option>
                                                @else
                                                     <option value="{{$br->head_office_id}}">{{$br->head_office_name}}</option>
                                                @endif

                                            @endforeach
                                           
                                        </select>    
                                        </div>
                                    </div>

controller(EDIT function)

public function edit($distributor_id)
    {
        //dd($company);

        $distributor=distributor::findOrFail($distributor_id);
        $HeadOffice=HeadOffice::get();

        $country=Country::where('country_name','India')->first();
        $state=State::where('country_id',$country->country_id)->get();
        $city=City::where('state_id',$distributor->dist_company_state)->get();
        $country=country::get();
        
        
        //$CompanyOtherInfo=CompanyOtherInfo::get();

       // $company=company::where('companies.company_id',$company_id)->get();

        $DistributorOtherInfos=DistributorOtherInfos::where('distributor_other_infos.distributor_id',$distributor_id)
       ->join('head_offices','distributor_other_infos.dist.dist_company_ho','=','head_offices.head_office_id') 
        ->first();

        //dd($industry);
        //dd($HeadOffice);
        //dd($program_type);
        return view('backend.distributor.editDistributor',compact('distributor','country','state','city','HeadOffice','DistributorOtherInfos'));
    }

Please sign in or create an account to participate in this conversation.