I need to combine 2 queries, but can´t figure out how

I have this query (checking for related key words, and by using COUNT(search_key.value) AS c, I can get the results where all key words match):

$query = Company::find()

            ->select('*, COUNT(search_key.value) AS c')


            ->groupBy('search_key.company')->having(['c' => count ($search_array)])


How can I change the "select all" *, to something like the following:

$query->select([‘valid_payment’=>"((’".$today."’<=to_date) AND (from_date<=’".$today."’))",‘id’, ‘name’]);

I have tried just replacing * with the select statement above, but that does not work…

Any suggestions? I need to order the once with valid_payment, and doing the check as described above used to fix that…