public function index() { $root = array(); $email = strim($GLOBALS['request']['email']); //用户名或邮箱 $pwd = strim($GLOBALS['request']['pwd']); //密码 $page = intval($GLOBALS['request']['page']); $mode = strim($GLOBALS['request']['mode']); //index,invite,ing,over,bad //检查用户,用户密码 $user = user_check($email, $pwd); $user_id = intval($user['id']); if ($user_id > 0) { $root['user_login_status'] = 1; $result = getInvestList($mode, $user_id, $page); $root['item'] = $result['list']; $root['page'] = array("page" => $page, "page_total" => ceil($result['count'] / app_conf("DEAL_PAGE_SIZE"))); } else { $root['response_code'] = 0; $root['show_err'] = "未登录"; $root['user_login_status'] = 0; } output($root); }
private function getlist($mode = "index") { $result = getInvestList($mode, intval($GLOBALS['user_info']['id']), intval($_REQUEST['p'])); $list = $result['list']; foreach ($list as $k => $v) { //当为天的时候 if ($v['repay_time_type'] == 0) { $true_repay_time = 1; } else { $true_repay_time = $v['repay_time']; } $deal['borrow_amount'] = $v['u_load_money']; $deal['rate'] = $v['rate']; $deal['loantype'] = $v['loantype']; $deal['repay_time'] = $v['repay_time']; $deal['repay_time_type'] = $v['repay_time_type']; $deal['repay_start_time'] = $v['repay_start_time']; $deal_repay_rs = deal_repay_money($deal); $v['interest_amount'] = $deal_repay_rs['month_repay_money']; $list[$k] = $v; } $count = $result['count']; $GLOBALS['tmpl']->assign("list", $list); $page = new Page($count, app_conf("PAGE_SIZE")); //初始化分页对象 $p = $page->show(); $GLOBALS['tmpl']->assign('pages', $p); $GLOBALS['tmpl']->assign('user_id', $GLOBALS['user_info']['id']); $GLOBALS['tmpl']->assign("page_title", $GLOBALS['lang']['UC_INVEST']); $GLOBALS['tmpl']->assign("inc_file", "inc/uc/uc_invest.html"); $GLOBALS['tmpl']->display("page/uc.html"); }
private function getlist($mode = "index") { $result = getInvestList($mode, intval($GLOBALS['user_info']['id']), intval($_REQUEST['p'])); $list = $result['list']; foreach ($list as $k => $v) { //当为天的时候 if ($v['repay_time_type'] == 0) { $true_repay_time = 1; } else { $true_repay_time = $v['repay_time']; } //本息还款金额 if ($v['loantype'] == 0) { $v['interest_amount'] = pl_it_formula($v['u_load_money'], $v['rate'] / 12 / 100, $true_repay_time) * $true_repay_time - $v['u_load_money']; } elseif ($v['loantype'] == 1) { $v['interest_amount'] = av_it_formula($v['u_load_money'], $v['rate'] / 12 / 100) * $true_repay_time - $v['u_load_money']; } elseif ($v['loantype'] == 2) { $v['interest_amount'] = $v['u_load_money'] * $v['rate'] / 12 / 100 * $true_repay_time - $v['u_load_money']; } $list[$k] = $v; } $count = $result['count']; $GLOBALS['tmpl']->assign("list", $list); $page = new Page($count, app_conf("PAGE_SIZE")); //初始化分页对象 $p = $page->show(); $GLOBALS['tmpl']->assign('pages', $p); $GLOBALS['tmpl']->assign("page_title", $GLOBALS['lang']['UC_INVEST']); $GLOBALS['tmpl']->assign("inc_file", "inc/uc/uc_invest.html"); $GLOBALS['tmpl']->display("page/uc.html"); }
public function index() { $root = array(); $email = strim($GLOBALS['request']['email']); //用户名或邮箱 $pwd = strim($GLOBALS['request']['pwd']); //密码 $page = intval($GLOBALS['request']['page']); $mode = strim($GLOBALS['request']['mode']); //index,invite,ing,over,bad //检查用户,用户密码 $user = user_check($email, $pwd); $user_id = intval($user['id']); if ($user_id > 0) { $root['user_login_status'] = 1; $status = intval($GLOBALS['request']['status']); $root['status'] = $status; /* * $status 1 进行中,2还款中,3已还清,4满标,5流标,0或其他 默认为全部 */ if (isset($status) && $status == "1") { $result = getInvestList($mode = "in", $user_id, $page, $email, $user['user_pwd']); //进行中 } elseif (isset($status) && $status == "2") { $result = getInvestList($mode = "ing", $user_id, $page, $email, $user['user_pwd']); //还款中 } elseif (isset($status) && $status == "3") { $result = getInvestList($mode = "over", $user_id, $page, $email, $user['user_pwd']); //已还清 } elseif (isset($status) && $status == "4") { $result = getInvestList($mode = "full", $user_id, $page, $email, $user['user_pwd']); //满标 } elseif (isset($status) && $status == "5") { $result = getInvestList($mode = "flow", $user_id, $page, $email, $user['user_pwd']); //流标 } else { $result = getInvestList($mode, $user_id, $page, $email, $user['user_pwd']); } //修改描述字段 $list_coyp = $result['list']; foreach ($list_coyp as $key => $value) { $list_coyp[$key]['description_ios'] = $list_coyp[$key]['description']; unset($list_coyp[$key]['descreption']); } $root['item'] = $list_coyp; $root['page'] = array("page" => $page, "page_total" => ceil($result['count'] / app_conf("DEAL_PAGE_SIZE")), "page_size" => app_conf("DEAL_PAGE_SIZE")); } else { $root['response_code'] = 0; $root['show_err'] = "未登录"; $root['user_login_status'] = 0; } $root['program_title'] = "我的投资"; output($root); }