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

志愿者修改

... ... @@ -1103,10 +1103,7 @@ class SecondController extends RestBaseController
}
$config=cmf_get_option('site_info');
$adminStartTime=strtotime("$date $activity[start_clock_time]");
// dump("$date $activity[start_clock_time]");
// dump($adminStartTime-$config['before_start_time']*60);
// dump($config['before_start_time']);
// dump($config);
$now=time();
... ... @@ -1120,7 +1117,7 @@ class SecondController extends RestBaseController
}
$update['status']=1;
$update['user_start']=time();
$result=db('clock')->where('id',$data['id'])->update(['user_start'=>$now]);
$result=db('clock')->where('id',$data['id'])->update(['user_start'=>$now,'status'=>'1']);
$this->success('打卡成功!');
}
... ... @@ -1162,7 +1159,7 @@ class SecondController extends RestBaseController
}
$update['status']=2;
$update['user_end']=time();
$result=db('clock')->where('id',$data['id'])->update(['user_end'=>$now]);
$result=db('clock')->where('id',$data['id'])->update(['user_end'=>$now,'status'=>'2']);
if ($result==1){
}
... ... @@ -1199,6 +1196,16 @@ class SecondController extends RestBaseController
$config['distinct']=500;
}
$info['distance']=$config['distinct'];
if (!empty($info['user_start'])){
$info['start_status']='已打卡';
}else{
$info['start_status']='未打卡';
}
if (!empty($info['user_end'])){
$info['end_status']='已打卡';
}else{
$info['end_status']='未打卡';
}
$this->success('',$info);
}
... ...
... ... @@ -76,6 +76,8 @@ class ClockController extends AdminBaseController
public function editPost(){
$id = input('id');
$update= $this->request->param();
$update['user_start']=strtotime($update['user_start']);
$update['user_end']=strtotime($update['user_end']);
$result=db('clock')->where('id',$id)->update($update);
$this->success('操作成功!');
}
... ...
... ... @@ -71,8 +71,16 @@
<tr>
<th width="100">用户结束打卡时间<span class="form-required">*</span></th>
<td>
<if condition="$data.user_end==0">
<input class="form-control" type="text" name="user_end"
type="time" value="{:date('Y-m-d H:i:s',$data.user_end)}" placeholder="请输入"/>
<else />
<input class="form-control" type="text" name="user_end"
type="time" value="{:date('Y-m-d H:i:s',$data.user_end)}" placeholder="请输入"/>
type="time" value="{:date('Y-m-d H:i:s',$data.user_end)}" placeholder="请输入"/>
</if>
</td>
</td>
</tr>
<tr>
... ...