Commit 1b0f4244 by LiuJunYi

excel增加字段

parent 09fb3225
...@@ -64,7 +64,9 @@ class User extends AuthBase ...@@ -64,7 +64,9 @@ class User extends AuthBase
$condition['nickname'] = ['like','%'.$nickname.'%']; $condition['nickname'] = ['like','%'.$nickname.'%'];
} }
if($is_vip){ if($is_vip){
$condition['is_vip'] = $is_vip; $condition['vip_endtime'] = ['>=',date('Y-m-d H:i:s')];
}else{
$condition['vip_endtime'] = ['<',date('Y-m-d H:i:s')];
} }
if($start_time&&$end_time){ if($start_time&&$end_time){
$condition['created_at'] = ['between',[$start_time.' 00:00:00',$end_time.' 00:00:00']]; $condition['created_at'] = ['between',[$start_time.' 00:00:00',$end_time.' 00:00:00']];
...@@ -75,27 +77,15 @@ class User extends AuthBase ...@@ -75,27 +77,15 @@ class User extends AuthBase
$condition['created_at'] = ['<',$end_time.' 00:00:00']; $condition['created_at'] = ['<',$end_time.' 00:00:00'];
} }
} }
$user_list = model('user')->where($condition)->field('nickname,gender,phone,is_vip,created_at,updated_at,vip_endtime')->select(); $user_list = model('user')->where($condition)->field('name,wx_number,nickname,gender,phone,is_vip,created_at,updated_at,vip_endtime')->select();
$mulit_arr = []; $mulit_arr = [];
$mulit_arr['data'] = []; $mulit_arr['data'] = [];
$cont = [['昵称','性别','电话','是否是会员','注册时间','更新时间','会员到期时间']]; $cont = [['真实姓名','微信号','昵称','性别','电话','是否是会员','注册时间','更新时间','会员到期时间']];
// [
// 'data'=>
// [
// [
// ['昵称','性别','电话','是否是会员','注册时间','更新时间','会员到期时间'],
// ['a','b','c'],
// ['d','e','f']
// ]
// ],
// 'sheet'=>
// [
// ['title'=>'工作空间1名称'],
// ['title'=>'工作空间2名称'],
// ]
// ];
foreach ($user_list as $vo){ foreach ($user_list as $vo){
$arr = []; $arr = [];
$arr[] = $vo['name'];
$arr[] = $vo['wx_number'];
$arr[] = $vo['nickname']; $arr[] = $vo['nickname'];
$arr[] = $vo['gender']==1?'男':'女'; $arr[] = $vo['gender']==1?'男':'女';
$arr[] = $vo['phone']; $arr[] = $vo['phone'];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment