修改店铺登录

This commit is contained in:
luofei 2024-06-03 10:01:51 +08:00
parent 9760d34129
commit 272597cc5c

View File

@ -44,15 +44,17 @@ class LoginLogic extends BaseLogic
{
$time = time();
$admin = Admin::where('account', '=', $params['account'])->find();
if($params['is_admin'] == 0 &&$admin){
$auth_shop=Db::name('user_auth_shop')->where(['admin_id'=>$admin['id'],'status'=>1,'apply_status'=>1,'type'=>2])->find();
if(!$auth_shop){
if ($params['is_admin'] == 0 && $admin) {
$auth_shop = Db::name('user_auth_shop')->where(['admin_id' => $admin['id'], 'status' => 1, 'apply_status' => 1, 'type' => 2])->find();
if (!$auth_shop) {
throw new MyBusinessException('该账户没有权限');
}
}
if($admin &&$params['is_admin'] == 1){
$role_find=AdminRole::where('admin_id',$admin['id'])->where('role_id',1)->find();
if($role_find) throw new MyBusinessException('请使用供应商后台登录');
if ($admin && $params['is_admin'] == 1) {
$role_find = AdminRole::where('admin_id', $admin['id'])->where('role_id', 'in', [1, 2])->find();
if ($role_find) {
throw new MyBusinessException('没有权限访问');
}
}
//用户表登录信息更新
$admin->login_time = $time;