Multiple Labels on editor action

Multiple Labels on editor action

mRendermRender Posts: 151Questions: 26Answers: 13

So I have this code, which works: ->selectDistinct( 'sites', 'id as value, name as label' )

I want something like this: ->selectDistinct( 'sites', 'id as value, name, lastname as label' )

But everything I try gives me invalid JSON responses back.

This question has an accepted answers - jump to answer

Answers

  • mRendermRender Posts: 151Questions: 26Answers: 13

    Oh I saw the one-to-many join, which is probably what I need here.

  • allanallan Posts: 63,512Questions: 1Answers: 10,472 Site admin
    Answer ✓

    Are you looking to concatenate the first name and last name together? You could use the sql method and execute a query directly which uses a string concat function for your database type. Or you could just loop over the result in PHP and combine the fields together into the required array.

    Allan

This discussion has been closed.