是否可以将关联表合并为Union?将其与条件一起显示
$this->paginate = [
'contain' => ['Users', 'Posts', 'Comment', 'likes'],
];
$tweets = $this->paginate($this->lists);
类似于查询生成器,因此我还可以为帖子和评论添加条件
$table1 = $this->tableName
->find()
->join()
->where()
$table2 = $this->tableName
->find()
->join()
->where()
$Union->Union($table1)
1条答案
按热度按时间nkkqxpd91#
使用联合可以执行如下操作