|
|
@@ -270,7 +270,7 @@ class GroupUser extends Base
|
|
|
return $this->error($e->getError());
|
|
|
}
|
|
|
}
|
|
|
- //选择今日出工人员
|
|
|
+ //添加今日出工人员
|
|
|
public function set_worker_out(GroupUserModel $groupUserModel, UserModel $userModel, WorkerOutModel $workerOutModel)
|
|
|
{
|
|
|
$param = $this->request->post();
|
|
|
@@ -282,7 +282,7 @@ class GroupUser extends Base
|
|
|
$pid=$this->userinfo['id'];
|
|
|
$time=time();
|
|
|
foreach ($list as $key => $value) {
|
|
|
- $state=$this->get_worker_out_state($value,$pid);
|
|
|
+ $state=$this->get_worker_out_state((int)$value,$pid);
|
|
|
if($state>0) continue;
|
|
|
$item=[
|
|
|
'user_id'=>(int)$value,
|
|
|
@@ -334,6 +334,10 @@ class GroupUser extends Base
|
|
|
//获取今天出工人员状态,0=未出个,1=出工
|
|
|
public function get_worker_out_state($id,$pid)
|
|
|
{
|
|
|
+ $groupUserModel=new GroupUserModel();
|
|
|
+ $count=$groupUserModel->where('id',$id)->where('pid',$pid)->count();
|
|
|
+ if($count==0) return 1;
|
|
|
+
|
|
|
$workerOutModel=new WorkerOutModel();
|
|
|
$todayTime = strtotime('today');
|
|
|
$where=[];
|