|
@@ -39,19 +39,22 @@ void forbid_staff_down_mine::init_forbid_staff(int id /* = -1*/)
|
|
|
//如果存在则查找更新。查找不到则插入
|
|
|
if (s)
|
|
|
{
|
|
|
+ bool f=false;
|
|
|
for (SForbidStaffInfo &info : s->forbidList)
|
|
|
{
|
|
|
//找到记录则更新,停止.找不到,则继续往下走
|
|
|
if (info.db_id == key)
|
|
|
{
|
|
|
+ f=true;
|
|
|
info.start_time = tool_time::to_time(start_time);
|
|
|
info.end_time = tool_time::to_time(end_time);
|
|
|
info.state = state;
|
|
|
log_info("Check Forbid_staff_down_mine DBID:%d Staff:%d State:%d Time:%s -> %s . "
|
|
|
,key,staff_id,state,start_time.c_str(),end_time.c_str());
|
|
|
- continue;
|
|
|
+ break;
|
|
|
}
|
|
|
}
|
|
|
+ if(f)continue;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -96,7 +99,7 @@ void forbid_staff_down_mine::del_forbid_data(int id,int staff_id)
|
|
|
//是否禁止状态
|
|
|
bool forbid_staff_down_mine::IsForbid(int staff_id,time_t cur_time)
|
|
|
{
|
|
|
- auto flist = m_map;
|
|
|
+ auto flist = forbid_staff_down_mine::instance()->m_map;
|
|
|
auto it = flist.find(staff_id);
|
|
|
if (it != flist.end())
|
|
|
{
|