wupengfei 2 年之前
父节点
当前提交
a74dd4c9c6
共有 1 个文件被更改,包括 9 次插入1 次删除
  1. 9 1
      application/user/controller/Member.php

+ 9 - 1
application/user/controller/Member.php

@@ -56,12 +56,20 @@ class Member extends Controller
         if($phone = input('get.phone')) $where[] = ['m.phone','like','%'.$phone.'%'];
         if($level_id = input('get.level_id')) $where[] = ['m.level_id','=',$level_id];
         $field="m.id,m.openid,m.name,m.headimg,m.level_exp,m.phone,m.status,m.create_at,w.growth,w.integral,w.money";
+        $create_at = input('create_at');
         $query = $this->_query($this->table)
             ->field($field)
             ->alias('m')
             ->leftJoin('UserWallet w','m.id =w.user_id')
             ->where($where)
-            ->dateBetween('create_at')->order('id desc')->page();
+            ->when($create_at,function ($q)use ($create_at){
+                if($create_at){
+                    $time = explode(' - ',$_GET['create_at']);
+                    $start_date_time = $time[0];
+                    $end_date_time =  $time[1];
+                    $q->whereBetweenTime('m.create_at',$start_date_time,$end_date_time);
+                }
+            })->order('id desc')->page();
     }
 
     /**