This commit is contained in:
mzl
2025-10-13 15:40:46 +08:00
parent 44da0615ee
commit 0752abd26d
5 changed files with 40 additions and 18 deletions
+14 -14
View File
@@ -2,6 +2,7 @@
namespace app\common\utils;
use app\common\model\UserRoles;
use GatewayWorker\Lib\Gateway;
use app\common\utils\WsResponse;
use app\common\service\MessageNotificationsService;
@@ -303,30 +304,29 @@ class WsEvents
public function initCheck(int $userId)
{
$data = [
'is_report_to' => false,
'is_office_clerk' => false,
// 'is_report_to' => false,
// 'is_office_clerk' => false,
'is_sign' => false
];
$user = \app\common\model\User::find($userId);
if ($user->report_to > 0) {
$data['is_report_to'] = true;
}
// if ($user->report_to > 0) {
// $data['is_report_to'] = true;
// }
if ($user->sign_img !== null && $user->sign_img !== '') {
$data['is_sign'] = true;
}
$ug = \app\common\model\UserGroupMembers::with(['group' => function($query) {
$query->where('scenario_code', 'stock_orders');
}])->where('user_id', $userId)->first();
if ($ug !== null) {
$data['is_office_clerk'] = true;
}
// $ug = \app\common\model\UserGroupMembers::with(['group' => function($query) {
// $query->where('scenario_code', 'stock_orders');
// }])->where('user_id', $userId)->first();
// if ($ug !== null) {
// $data['is_office_clerk'] = true;
// }
if ($data['is_report_to'] && $data['is_office_clerk'] && $data['is_sign']) {
Redis::hSet('user:init:check:'.$userId, 'status', 1);
if ($data['is_sign']) {
Redis::hSet('user:check:sign'.$userId, 'status', 1);
}
return $data;