<?php
namespace app\admin\model;
use think\Model;

// 引入框架内置类
use think\facade\Db;
use think\facade\Event;
use think\facade\Session;
use think\facade\Request;

class User extends Model{
	
    // 定义时间戳字段名
    protected $createTime = 'time';

	
	//获取数据
    public static function list_data($limit){
		$tdata=Request::param();
		
		if(!empty($tdata['strtime'])){
			$map[] = ['time','>=', strtotime($tdata['strtime'])];
		}
		if(!empty($tdata['endtime'])){
			$map[] = ['time','<=', strtotime($tdata['endtime'])];
		}
		if(!empty($tdata['keyword'])){
			$map[] = ['phone','like',"".$tdata['keyword']."%"];
		}

		$map[]=['id','<>',''];
		$list=Db::name('user')->where([$map])->order('time desc')->paginate(['list_rows' =>$limit,'query' => request()->param(),])->toArray();
		return $list;
	}

	
}