sex status
This commit is contained in:
parent
34ada257ea
commit
e0e5b7a0bb
@ -26,16 +26,16 @@ class User extends AdminController
|
|||||||
public function list()
|
public function list()
|
||||||
{
|
{
|
||||||
if(Request::isAjax()){
|
if(Request::isAjax()){
|
||||||
$data = Request::only(['id','name','email','sex']);
|
$datas = Request::only(['id','name','email','sex']);
|
||||||
$map = array_filter($data);
|
$map = array_filter($datas);
|
||||||
$user = Db::name('user')->where(['delete_time'=>0])->where($map)->order('id desc')->select();
|
$user = Db::name('user')->where(['delete_time'=>0])->where($map)->order('id desc')->select();
|
||||||
$count = $user->count();
|
$count = $user->count();
|
||||||
$res = [];
|
$res = [];
|
||||||
if($count){
|
if($count){
|
||||||
|
$res = ['code'=>0,'msg'=>'','count'=>$count];
|
||||||
foreach($user as $k => $v){
|
foreach($user as $k => $v){
|
||||||
$data = ['id'=>$v['id'],'username'=>$v['name'],'avatar'=>$v['user_img'],'phone'=>$v['phone'],'email'=>$v['email'],'sex'=>$v['sex'],'ip'=>$v['last_login_ip'],'jointime'=>date("Y-m-d",$v['create_time']),'check'=>$v['status'],'auth'=>$v['auth']];
|
$data = ['id'=>$v['id'],'username'=>$v['name'],'avatar'=>$v['user_img'],'phone'=>$v['phone'],'email'=>$v['email'],'sex'=>$v['sex'],'ip'=>$v['last_login_ip'],'jointime'=>date("Y-m-d",$v['create_time']),'check'=>$v['status'],'auth'=>$v['auth']];
|
||||||
//$res['data'][] = $data;
|
$res['data'][] = $data;
|
||||||
$res = ['code'=>0,'msg'=>'','count'=>$count,'data'=>[$data]];
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$res = ['code'=>-1,'msg'=>'没有查询结果!'];
|
$res = ['code'=>-1,'msg'=>'没有查询结果!'];
|
||||||
|
@ -36,8 +36,8 @@
|
|||||||
<div class="layui-form-item">
|
<div class="layui-form-item">
|
||||||
<label class="layui-form-label">性别</label>
|
<label class="layui-form-label">性别</label>
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
<input type="radio" name="sex" value="1" {if condition="$admin['sex'] eq 1"} checked {/if} title="男">
|
<input type="radio" name="sex" value="0" {if condition="$admin['sex'] eq 1"} checked {/if} title="男">
|
||||||
<input type="radio" name="sex" value="0" {if condition="$admin['sex'] eq 0"} checked {/if} title="女">
|
<input type="radio" name="sex" value="1" {if condition="$admin['sex'] eq 0"} checked {/if} title="女">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!--div class="layui-form-item">
|
<!--div class="layui-form-item">
|
||||||
|
@ -28,9 +28,9 @@
|
|||||||
<label class="layui-form-label">性别</label>
|
<label class="layui-form-label">性别</label>
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
<select name="sex">
|
<select name="sex">
|
||||||
<option value="0">不限</option>
|
<option value="">不限</option>
|
||||||
<option value="1">男</option>
|
<option value="0">男</option>
|
||||||
<option value="2">女</option>
|
<option value="1">女</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -53,7 +53,7 @@
|
|||||||
<img style="display: inline-block; width: 50%; height: 100%;" src= {{ d.avatar }}>
|
<img style="display: inline-block; width: 50%; height: 100%;" src= {{ d.avatar }}>
|
||||||
</script>
|
</script>
|
||||||
<script type="text/html" id="sex">
|
<script type="text/html" id="sex">
|
||||||
{{# if(d.sex == 1){ }}
|
{{# if(d.sex == 0){ }}
|
||||||
<button class="layui-btn layui-btn-normal layui-btn-xs" >男</button>
|
<button class="layui-btn layui-btn-normal layui-btn-xs" >男</button>
|
||||||
{{# } else { }}
|
{{# } else { }}
|
||||||
<button class="layui-btn layui-btn-danger layui-btn-xs">女</button>
|
<button class="layui-btn layui-btn-danger layui-btn-xs">女</button>
|
||||||
@ -96,7 +96,7 @@
|
|||||||
//监听搜索
|
//监听搜索
|
||||||
form.on('submit(LAY-user-front-search)', function(data){
|
form.on('submit(LAY-user-front-search)', function(data){
|
||||||
var field = data.field;
|
var field = data.field;
|
||||||
console.log(field);
|
//console.log(field);
|
||||||
|
|
||||||
//提交 Ajax 成功后,静态更新表格中的数据
|
//提交 Ajax 成功后,静态更新表格中的数据
|
||||||
$.ajax({
|
$.ajax({
|
||||||
|
@ -34,8 +34,8 @@
|
|||||||
<div class="layui-form-item" lay-filter="sex">
|
<div class="layui-form-item" lay-filter="sex">
|
||||||
<label class="layui-form-label">选择性别</label>
|
<label class="layui-form-label">选择性别</label>
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
<input type="radio" name="sex" value="1" title="男" {if condition="$user['sex'] eq 1"} checked {/if}>
|
<input type="radio" name="sex" value="0" title="男" {if condition="$user['sex'] eq 0"} checked {/if}>
|
||||||
<input type="radio" name="sex" value="0" title="女" {if condition="$user['sex'] eq 0"} checked {/if}>
|
<input type="radio" name="sex" value="1" title="女" {if condition="$user['sex'] eq 1"} checked {/if}>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="layui-form-item layui-hide">
|
<div class="layui-form-item layui-hide">
|
||||||
|
@ -31,8 +31,8 @@
|
|||||||
<div class="layui-form-item" lay-filter="sex">
|
<div class="layui-form-item" lay-filter="sex">
|
||||||
<label class="layui-form-label">选择性别</label>
|
<label class="layui-form-label">选择性别</label>
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
<input type="radio" name="sex" value="1" title="男" checked>
|
<input type="radio" name="sex" value="0" title="男" checked>
|
||||||
<input type="radio" name="sex" value="0" title="女">
|
<input type="radio" name="sex" value="1" title="女">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="layui-form-item layui-hide">
|
<div class="layui-form-item layui-hide">
|
||||||
|
@ -26,8 +26,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="layui-inline">
|
<div class="layui-inline">
|
||||||
<div class="layui-input-inline">
|
<div class="layui-input-inline">
|
||||||
<input type="radio" name="sex" value="1" {if condition="$user['sex'] eq 1"} checked {/if} title="男">
|
<input type="radio" name="sex" value="0" {if condition="$user['sex'] eq 0"} checked {/if} title="男">
|
||||||
<input type="radio" name="sex" value="0" {if condition="$user['sex'] eq 0"} checked {/if} title="女">
|
<input type="radio" name="sex" value="1" {if condition="$user['sex'] eq 1"} checked {/if} title="女">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user