public function wordOne(){ return $this->hasOne('TeachWord','id','w_id')->field('id,pid,title'); }
查询:以pid为条件查询
$sql = new TeachNews(); $sql= $sql->hasWhere('wordOne',['pid'=>$search['wordList']]);
public function wordOne(){ return $this->hasOne('TeachWord','id','w_id')->field('id,pid,title'); }
查询:以pid为条件查询
$sql = new TeachNews(); $sql= $sql->hasWhere('wordOne',['pid'=>$search['wordList']]);