php mysql 按照指定年月查找数据 数据库create_time为时间戳


$moneyloglist
= MoneyLog::where(['user_id' => $this->auth->id]) ->where($where) ->where("FROM_UNIXTIME(createtime,'%Y-%m')='".$time."'") ->order('id desc') ->limit($offset, $num) ->select();

语法:FROM_UNIXTIME(unix_timestamp,format)
posted @ 2019-12-03 09:33  MoonyHee  阅读(855)  评论(0编辑  收藏  举报