$shop_sql= Shop::find()
->select("shop.id,shop.name,shop.user_id,company_user.phone,user.user_name")
->where($shop_where)
->leftJoin('shop_user', 'shop_user.shop_id=shop.id')
->leftJoin('user_center.user_info as user', 'user.id=shop_user.device_id')
->leftJoin('company_user', 'company_user.id=shop.user_id')->createCommand()->getRawSql();
Yii2打印sql语句的写法
最新推荐文章于 2025-05-11 01:49:32 发布
本文深入探讨了在Yii框架下使用SQL进行复杂联表查询的技术细节,包括多个表之间的连接、字段选择及条件过滤等关键操作。通过具体示例,展示了如何在PHP中构建并执行复杂的SQL查询语句。

2990

被折叠的 条评论
为什么被折叠?



