作者 sgj
1 个管道 的构建 失败 耗费 3 秒

志愿者导出信息

... ... @@ -755,4 +755,27 @@ class ActivityController extends AdminBaseController
return $this->fetch();
}
public function addtimepost(){
$id=input('id');
$time=input('time');
$map['activity_id']=$id;
$map['status']=['in','1,3'];
$join=\db('join')->where($map)->select();
foreach ($join as $k=>$v){
/*是否已经设置过时间*/
if (empty($v['work_time'])){
/*添加用户时间和活动时间*/
\db('join')->where('id',$v['id'])->update(['work_time'=>$time]);
\db('volunteer')->where('user_id',$v['user_id'])->setInc('work_time',$time);
$flag=1;
}
}
if (isset($flag)){
$this->success('设置工作时长成功!');
}else{
$this->error('全部已经确定了工作时长');
}
}
}
\ No newline at end of file
... ...
... ... @@ -4,11 +4,11 @@
<div class="wrap">
<ul class="nav nav-tabs">
</ul>
<form id="refund_form" method="post" class="form-horizontal js-ajax-form margin-top-20" action="{:url('joinUnPass')}">
<form id="refund_form" method="post" class="form-horizontal js-ajax-form margin-top-20" action="{:url('addtimePost')}">
<div class="form-group ">
<label for="input-name" class="col-sm-2 control-label"><span class="form-required">*</span>拒绝理由</label>
<label for="input-name" class="col-sm-2 control-label"><span class="form-required">*</span>工时时长(h)</label>
<div class="col-md-10 col-sm-10">
<input class="form-control" type="text" required name="refund_reason" id="refund_reason" value="" placeholder="请输入拒绝理由">
<input class="form-control" type="number" required name="time" id="refund_reason" value="" placeholder="请输入工作时长">
</div>
</div>
<input type="hidden" name="id" value="{$id}">
... ...
... ... @@ -202,7 +202,7 @@
function addtime(res) {
var selectedCategoriesId = res
console.log(res)
openIframeLayer("{:url('activity/addtime')}?id=" + selectedCategoriesId, '拒绝信息', {
openIframeLayer("{:url('activity/addtime')}?id=" + selectedCategoriesId, '输入工时', {
area: ['700px', '300px'],
btn: ['确定','取消'],
yes: function (index, layero) {
... ... @@ -210,10 +210,6 @@
console.log(index)
console.log(layero)
var iframeWin= window[layero.find('iframe')];
// console.log('222222222222');
/* console.log($('#refund_form').html());
$('#refund_form').submit();*/
var body = layer.getChildFrame('body', index);
var iframeWin = window[layero.find('iframe')[0]['name']]; //得到iframe页的窗口对象,执行iframe页的方法:
iframeWin.load();
... ...