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
@@ -129,6 +129,8 @@ class StockOrdersService
}
}
// 检查绑定
(new UserService())->checkBind($userId);
return $data;
}
+22
View File
@@ -227,4 +227,26 @@ class UserService
return $config;
}
public function checkBind($userId)
{
$user = \app\common\model\User::find($userId);
if (!$user->report_to) {
throw new BusinessException('请先前往个人中心-绑定直属上级');
}
if ($user->sign_img === null || $user->sign_img === '') {
throw new BusinessException('请先前往个人中心-操作签名');
}
$ug = \app\common\model\UserGroupMembers::with(['group' => function($query) {
$query->where('scenario_code', 'stock_orders');
}])->where('user_id', $userId)->first();
if (!$ug) {
throw new BusinessException('请先前往个人中心-绑定内勤');
}
return true;
}
}