Commit 39ff7e1a authored by 吴贤德's avatar 吴贤德

修改登录逻辑,session('_USER_SPID_LIST', $spIDList); —> session('sp_ids', $spIDList);

parent 7c34758d
...@@ -47,7 +47,11 @@ class LoginAction extends Action{ ...@@ -47,7 +47,11 @@ class LoginAction extends Action{
foreach ($spList as $sp) { foreach ($spList as $sp) {
$spIDList[] = $sp['id']; $spIDList[] = $sp['id'];
} }
session('_USER_SPID_LIST', $spIDList); // session('_USER_SPID_LIST', $spIDList);
$sp_ids="0";
if (!empty($spIDList))
$sp_ids=implode(",",$spIDList);
session('sp_ids', $spIDList);
} }
$login_count = $r['login_count'] + 1; $login_count = $r['login_count'] + 1;
...@@ -166,7 +170,11 @@ class LoginAction extends Action{ ...@@ -166,7 +170,11 @@ class LoginAction extends Action{
foreach ($spList as $sp) { foreach ($spList as $sp) {
$spIDList[] = $sp['id']; $spIDList[] = $sp['id'];
} }
session('_USER_SPID_LIST', $spIDList);; // session('_USER_SPID_LIST', $spIDList);;
$sp_ids="0";
if (!empty($spIDList))
$sp_ids=implode(",",$spIDList);
session('sp_ids', $spIDList);
} }
$login_count = $r['login_count'] + 1; $login_count = $r['login_count'] + 1;
......
...@@ -19,7 +19,7 @@ class UserModel extends RelationModel{ ...@@ -19,7 +19,7 @@ class UserModel extends RelationModel{
} }
//获取用户绑定的SP列表 //获取用户绑定的SP列表
public function getSpList($id){ public function getSpList($id){
$sql="SELECT sp.id,sp.code,sp.name FROM vsdn_sp_user_map vsum,vsdn_sp sp" $sql="SELECT sp.id,sp.code,sp.name FROM sh_sp_user_map vsum,vsdn_sp sp"
." WHERE vsum.user_id=$id AND vsum.status=0 AND sp.status=0 AND sp.id=vsum.sp_id" ." WHERE vsum.user_id=$id AND vsum.status=0 AND sp.status=0 AND sp.id=vsum.sp_id"
." ORDER BY sp.id ASC;"; ." ORDER BY sp.id ASC;";
$model = new Model(); $model = new Model();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment