PHP查询指定日期内的内容

if(IS_POST){
    $rqstart = I('rqstart');
    $rqend = I('rqend');
    $begintime = strtotime($rqstart. ' 00:00:00');
    $endtime = strtotime($rqend. ' 23:59:59');

    //日期范围内查询条件
    $map['billing_time'] = array(array('EGT', $begintime), array('ELT', $endtime));

    $alipay    = $Billing->where($map)->where(array('billing_pay_manner'=>'alipay'))->sum('billing_price');
    $weixinpay = $Billing->where($map)->where(array('billing_pay_manner'=>'weixinpay'))->sum('billing_price');

    //组装数据
    if($weixinpay>0 or $alipay>0){
        $data=array("alipay"=>"$alipay","weixinpay"=>"$weixinpay");
        $this->ajaxReturn($data);
    }else{
        $data="-1";
        $this->ajaxReturn($data);
    }
}

标签: none

添加新评论