tp5.0查询mysql8

张开手 张开手 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
$fangtai_arr = db("t_wxroomstatus")->field("F_RoomType,count(*) as RoomNum,sum(case when F_RoomStatus='入住' then 0 else 1 end) as KongRoomNum,sum(case when F_RoomStatus='入住' then 1 else 0 end) as InRoomNum") ->where('F_Comkey',30000825) ->group("F_RoomType") ->select();

这里的查询数据,case when 函数,条件用到中文“入住”,会乱码,查询也会有问题,这该怎么解决
...全文
评论 2
收藏 已收藏
分享
返回顶部
张开手
基础编程 21,889 成员 140,329 内容