thinkphp 查询单个“年-月-日” FROM_UNIXTIME

时间:2022-02-27 04:48:28
*时间格式转换,使datetimepicker.js 能够搜索 查询 单个 年月日而不需是区间

查询。

//另起一行看转换结果
select *,FROM_UNIXTIME(CreateTime,'%Y-%m-%d') as date from lg_recharge //where条件查询测试
select * from lg_recharge where FROM_UNIXTIME(CreateTime,'%Y-%m-%d') ='2017-06-27' //融合到整体查询中
select r.Id,u.username,u.name,u.email,r.OrderNumber,r.Paytype,r.Money,r.CreateT ime,r.Status,r.Usertype from lg_recharge as r left join lg_users as u on r.UserId=u.id Where r.Usertype='1' and u.username LIKE '%15575869648%' and FROM_UNIXTIME(CreateTime,'%Y-%m-%d')='2014-11-06'