作者 sgj
1 个管道 的构建 通过 耗费 1 秒

选择多人员

... ... @@ -176,13 +176,15 @@ class GroupController extends AdminBaseController
public function groupPeopleAdd(){
$user_id=explode(',',input('user_id'));
dump($user_id);
foreach ($user_id as $k=>$v){
$insert[$k]['user_id']=$v;
$insert[$k]['group_id']=input('group_id');
$insert[$k]['addtime']=time();
}
dump($insert);
db('group_user')->insertAll($insert);
$this->success();
// $this->success();
}
}
\ No newline at end of file
... ...
... ... @@ -8,7 +8,7 @@
<form class="well form-inline margin-top-20 js-ajax-form" method="post" action="{:url('groupPeopleAdd',['group_id'=>$group.id])}">
添加用户
<input class="form-control" type="text" required="" placeholder="请选择用户" onclick="doSelectUsers();" id="js-users-name-input" readonly="" aria-required="true">
<input class="form-control" type="hidden" name="post[author_id]" value="" name="user_id" id="js-users-id-input"/>
<input class="form-control" type="hidden" value="" name="user_id" id="js-users-id-input"/>
<input type="submit" class="btn btn-primary js-ajax-submit" value="确定"/>
<a class="btn btn-danger" href="{:url('user/adminIndex/index')}">清空</a>
... ...