The data printed by TP5 has specific fields, so why is it wrong to add this field in the where statement?

public function Question()
{
    return $this->belongsTo("Question", "QuestionId", "QuestionId")->bind("Title");
}

public function Questionoption()
{
    return $this->belongsTo("Questionoption", "AnswerId", "OptionId")->bind("Content");
}

public function UserLog(){
    return $this->belongsTo("userlog", "UserId", "UserId")->bind("IsFinish");

}
public function UserList(){
    return $this->belongsTo("userlist", "UserId", "UserId")->bind("NickName,Sex");

}



public function getQuestss($request)
{
    $get = $request->param();

    $map = array();
    if (isset($get["State"])){
        $map["IsFinish"] = $get["State"];//

    }

/ / add judgment and report an error

    $data = $this->with("Question,Questionoption,UserLog,UserList")->where($map)->select()->toArray();
    print_r($data);die;
    
    
    
    :SQLSTATE[42S22]: Column not found: 1054 Unknown column "IsFinish" in "where clause"
      where  

clipboard.png

Jul.09,2021
Menu