Column not found: Unknown column in where clause

Following is the association


$this->belongsTo('Districts', [
    'foreignKey' => 'district_id'
$this->hasMany('Students', [
    'foreignKey' => 'school_id'

Each school has many students
Each school belongs to a district

Let’s say there are 4 districts. ( = 1,2,3,4)
In School’s Model, I’m trying to fetch the list of all students.
But if the district is 1 or 2, I want to show only those students who scored more than 50 marks.
And for the other districts, I am trying to show students who scored less than 35 marks.
This is the finder function I wrote for the above mentioned.

public function findStudentsList(Query $query, array $options)
        'Districts'=> function ($query) {
            return $query->select(['id','name']);
        'Students'  => function ($query) {
            return $query->where([
                WHEN THEN Students.marks >50 
                WHEN THEN Students.marks >50 
                ELSE Students.marks < 35 

But when I execute this, I get the following error.

Column not found: Unknown column '' in 'where clause'

Is this the right way to do it? I’m new to CakePHP3.

Used district_id instead of and it worked.