|
@@ -42,9 +42,10 @@ void forbid_staff_down_mine::init_forbid_staff(int id /* = -1*/)
|
|
|
int state;
|
|
|
DBRes.GetField("status", state, Error);
|
|
|
|
|
|
+ std::shared_ptr<SForbidStaffList> s = nullptr;
|
|
|
if (id != -1)
|
|
|
{
|
|
|
- auto s = forbid_staff_down_mine::instance()->get(s_id);
|
|
|
+ s = forbid_staff_down_mine::instance()->get(s_id);
|
|
|
if (s != nullptr)
|
|
|
{
|
|
|
for (SForbidStaffInfo &info : s->forbidList)
|
|
@@ -54,14 +55,15 @@ void forbid_staff_down_mine::init_forbid_staff(int id /* = -1*/)
|
|
|
info.start_time = tool_time::to_time(start_time);
|
|
|
info.end_time = tool_time::to_time(end_time);
|
|
|
info.state = state;
|
|
|
- break;
|
|
|
+ return;
|
|
|
}
|
|
|
}
|
|
|
- return;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- std::shared_ptr<SForbidStaffList> s = std::make_shared<SForbidStaffList>();
|
|
|
+ if (s == nullptr)
|
|
|
+ {
|
|
|
+ s = std::make_shared<SForbidStaffList>();
|
|
|
+ }
|
|
|
s->staff_id = s_id;
|
|
|
SForbidStaffInfo info ;
|
|
|
info.staff_id = s_id;
|