private function _getCustomerInfoByMap($map) { //获取当前业绩信息 $ach = new AchievementModel(); $achInfo = $ach->getCurrentInfo(); $this->assign('achievement', $achInfo); $customer = new CustomerModel(); $customer->setMap($map); $count = $customer->getCountByMap(); $page = $this->page; $currentPage = I('get.p', 1); $page->setCounts($count); $page->setCurrentPage($currentPage); $page->setPageStyle(2); $pageStr = $page->fetch(); $currentPage = $page->getCurrentPage(); $pageSize = $page->getPageSize(); $menuList = $customer->getDataArrByMap($currentPage, $pageSize); $key = 'openid'; $menuList = change_key($menuList, $key); //截取本页内容 $this->assign('page', $pageStr); foreach ($menuList as $key => $value) { $menuList[$key]['actionUrl']['edit'] = U('Customer/Edit/index?id=' . $value['id']); $menuList[$key]['actionUrl']['freezen'] = U('Customer/Freezen/index?id=' . $value['id']); $menuList[$key]['actionUrl']['look'] = U('Customer/Look/index?id=' . $value['id']); $menuList[$key]['actionUrl']['parent_look'] = U('Customer/Look/index?id=' . $value['parentid']); } //添加上级用户名称 foreach ($menuList as $key => $value) { $menuList[$key]['_parentname'] = $this->_addParentName($value['parentid']); } $css = $this->fetch('indexCss'); $this->assign('css', $css); $this->assign('customer', $menuList); $this->assign('listCustomerUrl', U('ListCustomer/index')); }
$time = $_POST["time"]; $verify = $_POST["verify"]; $time = (string) $time; $dbObj = new DBClass(); //再次确认是否已修改密码 $sql = "select * from cs_user where name='{$name}';"; $result = $dbObj->query($sql); if ($result->num_rows) { $userinfo = $result->fetch_assoc(); } else { echo "修改失败"; } $token = md5($userinfo['uid'] . $userinfo['password'] . $time); if ($verify == $token) { $key = md5($passwd); $result = change_key($key, $name); if ($result) { unset($_SESSION['uid']); echo "修改成功"; } else { echo "修改失败"; } } else { echo '<meta charset="utf-8">验证失败,该连接无效!'; } function change_key($key, $name) { $dbObj = new DBClass(); $sql = "update cs_user set password='******' where name='{$name}';"; if ($result = $dbObj->query($sql)) { return $result;
private function _getCustomerInfoByMap($map) { $customer = new CustomerModel(); $customer->setMap($map); $customerArr = $customer->getAllDataArrByMap(); $key = 'openid'; $customerArr = change_key($customerArr, $key); return $customerArr; }