select(' leads.*, kyc_entity_type.name as entity_type, policy_type.policy_type, user_profiles.first_name as salse_person_name ') ->join('kyc_entity_type', 'leads.entity_type_id = kyc_entity_type.id', 'left') ->join('user_profiles', 'leads.salse_person_id = user_profiles.id', 'left') ->join('policy_type', 'leads.policy_type_id = policy_type.id', 'left') ->where('leads.is_active', 1) ->where('leads.is_active', 1) ->where('leads.is_active', 1) ->orderBy('id', 'desc') ->findAll(); } }