/** * ription 用户帐号状态修改 * * @param int $status * 增加/减少 * * @param int $uid * 用户id */ public function reset_account_status() { if (!$this->check_power('account_manage')) { return; } $status = intval($this->input->post('status')); $uid = intval($this->input->post('uid')); // 检查是否存在该学生 $account = CommonModel::get_student($uid, 'account,account_status'); if (!count($account['account'])) { output_json(CODE_ERROR, '不存在该学生.'); } // 修改学生密码 $flag = CommonModel::reset_status($uid, $status); if (!$flag) { output_json(CODE_ERROR, '帐号修改失败,请重试'); } output_json(CODE_SUCCESS, '帐号修改成功.'); }
/** * 充值 */ public function paying() { if (!$this->_uinfo['uid']) { redirect('student/index/login'); } if (!C('paycharge_enable')) { message('您没有权限访问该功能'); } $uid = $this->_uinfo['uid']; $data = array(); $data['uinfo'] = $this->_uinfo; $account = trim($this->input->post('begin_time')); if (!is_numeric($account)) { message('请输入正确的数字'); } $account2 = bcadd($account, 0.0, 1); if (bccomp($account2, $account, 6) != 0) { message('请输入正确的最多保留一位小数的数字'); } if (bccomp($account2, '0.0', 1) <= 0) { message('请输入正确的大于零的数字'); } $account = $account2; $insert_array = array(); $insert_array = array(); if ($uid) { /* * 基本信息 */ $uid = intval($uid); $student = CommonModel::get_student($uid); if (empty($student)) { message('信息不存在'); return; } $tr_amount = $account * 10; $param = array('tr_uid' => $uid, 'tr_type' => 1, 'tr_flag' => 0, 'tr_money' => $student['account'] + $tr_amount, 'tr_cash' => $account, 'tr_trade_amount' => $tr_amount, 'tr_comment' => '支付宝充值'); $number = TransactionRecordModel::addTransactionRecord($param); $html_text = StudentAlipayModel::paying($number, $account); $data = array('html_text' => $html_text); $this->load->view('profile/paying', $data); } else { $this->load->view('profile/paying'); } }