public function updateBindRelation($account, $userId) { $account = mysql_real_escape_string($account); $userId = array_map('intval', $userId); /* *执行逻辑 先删除旧的 然后再批量插入新的 */ $delSql = "delete from msg_userAccountBind where account='{$account}'"; $delQuey = $this->dbConn->query($delSql); if (FALSE === $delQuey) { self::$errMsg = '更新失败!'; return FALSE; } foreach ($userId as $id) { $insertSql = "insert into msg_userAccountBind (account, userID) values ('{$account}', '{$id}')"; $this->dbConn->query($insertSql); } }
public function view_mailPushSettingList() { include_once WEB_PATH . 'lib/global_ebay_accounts.php'; //导入ebay平台账号 $bindObj = new UserAccountBindModel(); $relatio = array(); $userObj = new GetLoacalUserModel(); foreach ($GLOBAL_EBAY_ACCOUNT as $account) { $users = $bindObj->getBindInfo($account); foreach ($users as &$u) { $userInfo = $userObj->getUserInfoBySysId($u['userID']); $u['name'] = isset($userInfo['global_user_name']) ? $userInfo['global_user_name'] : ''; } $relation[$account] = $users; } $allowedList = $bindObj->getAllowedAccount($_SESSION['globaluserid']); $GLOBAL_EBAY_ACCOUNT = array_intersect($allowedList, $GLOBAL_EBAY_ACCOUNT); // print_r($relation);exit; $this->smarty->assign('accountList', $GLOBAL_EBAY_ACCOUNT); $this->smarty->assign('sec_menue', 4); $this->smarty->assign('toplevel', 4); $this->smarty->assign('powerList', $relation); $this->smarty->assign('toptitle', 'message类别列表'); $this->smarty->display('mailPushSettingList.htm'); }