where('cd_ck_idx', $ckIdx); if ($activeOnly) { $builder->where('cd_state', 1); } return $builder->orderBy('cd_sort', 'ASC')->findAll(); } }