TP5打印出来的数据有具体的字段,为什么加上where语句的这个字段的判断就报错

浏览:781 发布日期:2018/09/24 分类:求助交流
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'];//加上判断就报错

    }
//加上判断就报错    $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  就报错
不加where打印出来的是Array(
  [0] => array(
          [Isfinish] =>1
          [NickName]=>pt
          [sex]  =>男
  )
)
最佳答案
评论( 相关
后面还有条评论,点击查看>>