Browse Source

添加日期筛选

north 8 years ago
parent
commit
d51b640d7b
1 changed files with 4 additions and 0 deletions
  1. 4 0
      www/protected/modules/o2o/controllers/UserController.php

+ 4 - 0
www/protected/modules/o2o/controllers/UserController.php

@@ -76,6 +76,8 @@ class  UserController extends O2oBaseController{
 
     public function actionGetUserBalanceLog(){
         $id = Yii::app()->request->getParam('id', '');
+        $start_time = strtotime(Yii::app()->request->getParam('start_time',''));
+        $end_time = strtotime(Yii::app()->request->getParam('end_time',''));
 
         $params = CommonFn::getPageParams();
         $criteria = new EMongoCriteria($params);
@@ -86,6 +88,8 @@ class  UserController extends O2oBaseController{
         }else{
             CommonFn::requestAjax(false, "缺少必须参数");
         }
+        $criteria->time('>=',$start_time);
+        $criteria->time('<=',$end_time);
 
         $cursor = BalanceLog::model()->findAll($criteria);
         $total = $cursor->count();