gpt4 book ai didi

php - 在cakephp中获取当年的mysql记录

转载 作者:行者123 更新时间:2023-11-29 05:34:37 32 4
gpt4 key购买 nike

我需要在 cakephp 中获取一年间隔内的记录。我尝试按 time 条件进行以下查询无效。

$accept = $this->AssignListing->find('all',array('conditions' => array('AssignListing.writer_id' => $writer,'AssignListing.status' => 1, 'AssignListing.date_added > NOW( ) - INTERVAL 1 YEAR')));

最佳答案

这对你有用。

$accept = $this->AssignListing->find('all',array('conditions' => array('AssignListing.writer_id' => $writer,'AssignListing.status' => 1, 'AssignListing.date_added >=' => 'DATE_ADD(NOW( ), INTERVAL -1 YEAR')));

关于php - 在cakephp中获取当年的mysql记录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11825019/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com