tp5 使用子查询时为什么报错表不存在

浏览:476 发布日期:2020/07/03 分类:求助交流
tp5 使用子查询时为什么报错表不存在
报错内容:SQLSTATE[42S02]: base table or view not found: 1146 Table 'kuaidi.(' doesn't exist

代码:
$subQuery=Db::field('count(*) as count')
->table('admin_member_users')
->union('SELECT count(*) as count FROM admin_member_usersfrom registration_time > "2020-07-03 00:00:00"')
->whereTime('registration_time','today')
->buildSql();

echo $subQuery;

$data=Db::table($subQuery.' a')
->field('count(*) as count')
->select();

echo $data;

$this->assign('data', $data);
return $this->fetch();
最佳答案
评论( 相关
后面还有条评论,点击查看>>