ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
#### 内连接 inner join ~~~ $articles = Be::getTable('system_user') ->alias('u') ->innerJoin('oms_order AS o', 'u.id = o.user_id') ->where('o.create_time', '>', '2017-12-01') ->getObjects('o.order_id, u.user_name'); ~~~ 等效SQL: ~~~ SELECT o.order_id, u.user_name FROM system_user AS u INNER JOIN oms_order AS o ON u.id = o.user_id WHERE o.create_time > '2017-12-01' ~~~ innerJoin 可使用别名简化函数 join ~~~ $articles = Be::getTable('system_user') ->alias('u') ->join('oms_order AS o', 'u.id = o.user_id') ->where('o.create_time', '>', '2017-12-01') ->getObjects('o.order_id, u.user_name'); ~~~