待使用订单搜索

This commit is contained in:
jianghanbo 2025-01-07 18:27:51 +08:00
parent 4a7ce8cb3f
commit 4dd1be6ddc
2 changed files with 7 additions and 6 deletions

View File

@ -216,6 +216,13 @@ class AdminController extends base
$post['end_work_time'] = time();
if ($post['is_order'] == 1){
$post['end_work_time'] = 0;
} else {
// 判断在线时长低于8小时不可下线
$admin = Admins::where('id', $request->admin->id)->find();
$workTime = time() - $admin->start_work_time;
if ($workTime < 60*60*8) {
return $this->error(1004,'未满8小时暂不能下线请联系管理员');
}
}
try {

View File

@ -64,12 +64,6 @@ class LoginController extends base
}
public function Logout(Request $request) {
// 判断在线时长低于8小时不可下线
$admin = Admins::where('id', $request->admin->id)->find();
$workTime = time() - $admin->start_work_time;
if ($admin->is_order == 1 && $workTime < 60*60*8) {
return $this->error(1004,'未满8小时暂不能下线请联系管理员');
}
$md5 = md5($request->token);
Redis::set('Admin:logout:'.$md5, time() , 'EX', 3600*24);
setcookie('Admin-Token', '', time() - 3600);