作者:哥这么好的人你去哪找 | 来源:互联网 | 2018-05-20 12:54
{代码...}直接echo的话,显示如下14097642200我想返回大于100的值,就是那个140,但是现在用这个方法搞不定,返回的是0。请大家帮忙看下该如何解决,谢谢了!
function get_new_nums($days = 5)
{
$custom_time = time() - 86400 * $days;
$where['createtime > '] = $custom_time;
$piano_nums = $this->yuepu_models->list_whrere($where, 'COUNT(1) AS nums');
if ($piano_nums <100)
{
get_new_nums($days + 5);
}
//echo $piano_nums.'
;
return $piano_nums;
}
get_new_nums();
直接echo的话,显示如下
140
97
64
22
0
0
我想返回大于100的值,就是那个140,但是现在用这个方法搞不定,返回的是0。
请大家帮忙看下该如何解决,谢谢了!
回复内容:
function get_new_nums($days = 5)
{
$custom_time = time() - 86400 * $days;
$where['createtime > '] = $custom_time;
$piano_nums = $this->yuepu_models->list_whrere($where, 'COUNT(1) AS nums');
if ($piano_nums <100)
{
get_new_nums($days + 5);
}
//echo $piano_nums.'
;
return $piano_nums;
}
get_new_nums();
直接echo的话,显示如下
140
97
64
22
0
0
我想返回大于100的值,就是那个140,但是现在用这个方法搞不定,返回的是0。
请大家帮忙看下该如何解决,谢谢了!
function get_new_nums($days = 5)
{
$custom_time = time() - 86400 * $days;
$where['createtime > '] = $custom_time;
$piano_nums = $this->yuepu_models->list_whrere($where, 'COUNT(1) AS nums');
if ($piano_nums <100)
{
$piano_nums = get_new_nums($days + 5);
}
//echo $piano_nums.'
;
return $piano_nums;
}
get_new_nums();