作者 sgj
2 个管道 的构建 失败 耗费 18 秒

修改活动列表信息

... ... @@ -769,7 +769,9 @@ class ActivityController extends AdminBaseController
public function addtime(){
$id=input('id');
$user_id=input('user_id');
$this->assign('id',$id);
$this->assign('user_id',$user_id);
return $this->fetch();
}
... ... @@ -777,24 +779,33 @@ class ActivityController extends AdminBaseController
public function addtimepost(){
$id=input('id');
$time=input('time');
$map['activity_id']=$id;
$map['status']=['in','1,3'];
$map['delete_time']=0;
$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)){
$user_id=input('user_id');
$map['activity_id']=$id;
// $map['status']=['in','1,3'];
// $map['delete_time']=0;
// $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;
// }
// }
$users=explode(',',$user_id);
foreach($users as $k=>$v){
\db('join')->where('id',$v)->update(['work_time'=>$time]);
$info= db('join')->where('id',$v)->find();
\db('volunteer')->where('user_id',$info['user_id'])->setInc('work_time',$time);
$flag=1;
}
$this->success('设置工作时长成功!');
/* if (isset($flag)){
$this->success('设置工作时长成功!');
}else{
$this->error('全部已经确定了工作时长');
}
}*/
}
}
\ No newline at end of file
... ...
... ... @@ -10,7 +10,7 @@
// [ 入口文件 ]
// 调试模式开关
define("APP_DEBUG", true);
define("APP_DEBUG", false);
// 定义CMF根目录,可更改此目录
define('CMF_ROOT', __DIR__ . '/../');
... ...
... ... @@ -12,6 +12,7 @@
</div>
</div>
<input type="hidden" name="id" value="{$id}">
<input type="hidden" name="user_id" value="{$user_id}">
<div style="display: none" class="form-group">
<label for="input-name" class="col-sm-2 control-label"><span class="form-required"></span></label>
<div class="col-md-6 col-sm-10">
... ...
... ... @@ -170,6 +170,9 @@
function userWork(res) {
var selectedCategoriesId = res
console.log(res)
openIframeLayer("{:url('activity/userWork')}?id=" + selectedCategoriesId, '请完善信息', {
area: ['1000px', '700px'],
// btn: ['确定', '取消'],
... ... @@ -219,7 +222,14 @@
function addtime(res) {
var selectedCategoriesId = res
console.log(res)
openIframeLayer("{:url('activity/addtime')}?id=" + selectedCategoriesId, '输入工时', {
var img_url =[];
$("input[name='ids[]']:checked").each(function(){
img_url.push($(this).val());
})
console.log(img_url)
var user_id=img_url.join(',');
console.log(user_id);
openIframeLayer("{:url('activity/addtime')}?id=" + selectedCategoriesId +"&user_id="+user_id, '输入工时', {
area: ['700px', '300px'],
btn: ['确定','取消'],
yes: function (index, layero) {
... ...