public function index() { if (!isset($_SESSION['userId']) || !isset($_SESSION['roleId'])) { $this->display('login'); } else { if ($_SESSION['roleId'] == 1) { $this->redirect("User/manager"); } else { $publicCon = new PublicController(); $data = $publicCon->infoLoad(); $this->assign("data", $data); $this->display(); } } }
public function _initialize() { parent::_initialize(); //各页面下拉选项列表 $school_year_options = D('SchoolYear')->getOptions($this->school_year); $town_id_options = get_town_options($this->town_id); $school_code_options = get_school_options($this->school_year, $this->town_id, $this->school_code); $this->assign('school_year_options', $school_year_options); $this->assign('town_id_options', $town_id_options); $this->assign('school_code_options', $school_code_options); }
public function index() { session_start(); header('Content-Type:text/html; charset=UTF-8'); //防止出现乱码 $username = $_SESSION['username']; $guarantee = PublicController::getDanbaoRate(); $this->assign('username', $username); $this->assign('guarantee', $guarantee * 100); //借贷列表 $Model = new \Think\Model(); $loanarr = $Model->query("select a.f_uid userid,a.f_username username,b.f_id vid,round(b.f_yield*100,2) yield,round(b.f_money) money,round(b.f_danbaomoney,2) danbaomoney,b.f_horizon horizon,b.f_state state,DATE_FORMAT(b.f_addtime,'%Y-%m-%d') addtime from t_userinfo a,t_loan b where a.f_uid=b.f_userid and b.f_state=0 order by b.f_addtime desc limit 20"); $this->assign('loanlist', $loanarr); $this->display(); }
public function _initialize() { parent::_initialize(); //各页面下拉选项列表 $school_year_options = D('SchoolYear')->getOptions($this->school_year); $town_id_options = get_town_options($this->town_id); $school_code_options = get_school_options($this->school_year, $this->town_id, $this->school_code); $this->assign('school_year_options', $school_year_options); $this->assign('town_id_options', $town_id_options); $this->assign('school_code_options', $school_code_options); //判断是否需要为模版年级和班级下拉框赋值 if (in_array(ACTION_NAME, array('template', 'receipt', 'cshedu')) && !IS_AJAX) { $school_grade_options = get_grade_options($this->school_year, $this->town_id, $this->school_code, $this->school_grade, 'school_code'); $class_num_options = get_class_options($this->school_year, $this->town_id, $this->school_code, $this->school_grade, $this->class_num); $this->assign('school_grade_options', $school_grade_options); $this->assign('class_num_options', $class_num_options); } }
public function _initialize() { parent::_initialize(); //各页面下拉选项列表 $school_year_options = D('SchoolYear')->getOptions($this->school_year); $town_id_options = get_town_options($this->town_id); $school_code_options = get_school_options($this->school_year, $this->town_id, $this->school_code); $this->assign('school_year_options', $school_year_options); $this->assign('town_id_options', $town_id_options); $this->assign('school_code_options', $school_code_options); //判断是否需要为模版年级和班级下拉框赋值 if (in_array(ACTION_NAME, array('stuInfo', 'printRegister', 'upNum', 'phydata', 'phydataRanking')) && !IS_AJAX) { $school_grade_options = get_grade_options($this->school_year, $this->town_id, $this->school_code, $this->school_grade); $class_num_options = get_class_options($this->school_year, $this->town_id, $this->school_code, $this->school_grade, $this->class_num); $this->assign('school_grade_options', $school_grade_options); $this->assign('class_num_options', $class_num_options); } //系统定义参数 $this->folkList = session('folkList'); $this->dictList = session('dictList'); }
public function _initialize(){ parent::_initialize(); }
public function _initialize(){ parent::_initialize(); $usecssjs = '<link href="'.__ROOT__.'/Public/css/index.css" rel="stylesheet" type="text/css" /><link href="'.__ROOT__.'/Public/css/pro_list.css" rel="stylesheet" type="text/css" /><link href="'.__ROOT__.'/Public/css/zc.css" rel="stylesheet" type="text/css" /><link href="'.__ROOT__.'/Public/css/font-awesome.min.css" rel="stylesheet" type="text/css" /><link href="'.__ROOT__.'/Public/css/false.css" rel="stylesheet" type="text/css" /><script type="text/javascript" src="'.__ROOT__.'/Public/js/jquery-1.8.2.min.js"></script><link href="'.__ROOT__.'/Public/js/artDialog/skins/blue.css" rel="stylesheet" type="text/css" /><script type="text/javascript" src="'.__ROOT__.'/Public/js/artDialog/jquery.artDialog.js"></script><script type="text/javascript" src="'.__ROOT__.'/Public/js/artDialog/plugins/iframeTools.js"></script><script type="text/javascript" src="'.__ROOT__.'/Public/js/jquery.countdown.min.js"></script><script type="text/javascript" src="'.__ROOT__.'/Public/js/common.js"></script><script type="text/javascript" src="'.__ROOT__.'/Public/js/dropMenu1.js"></script>'; $this->assign('usecssjs',$usecssjs); $this->assign('action_name','zhongchou'); }
public function addLoan() { //获取参数 $func = new Lib\Fun(); $avaiBalance = $userBalance = $frozeBalance = $danbaoMoney = 0; $loan_money = $func->checkint($func->getRequest('loan_money'), 0); $horizon = $func->checkint($func->getRequest('horizon'), 0); $loan_yield = floatval($func->getRequest('loan_yield', 0)); $guarantee = $func->checkint($func->getRequest("guarantee"), -1); $goods_type = $func->checkint($func->getRequest("goods_type"), -1); $goods_money = $func->checkint($func->getRequest("goods_money"), -1); if (empty($loan_money) || $loan_money <= 0) { $func->showMsg("请填写正确的贷款金额"); } if (empty($horizon) || $horizon <= 0) { $func->showMsg("请选择贷款期限"); } if ($goods_type == 1 && (empty($guarantee) || $guarantee <= 0)) { $func->showMsg("请选择保证金额度"); } if ($goods_type == 2 && (empty($goods_money) || $goods_money <= 0)) { $func->showMsg("货物抵押金额错误"); } if (empty($loan_yield) || $loan_yield <= 0) { $func->showMsg("请填写正确的利率"); } //计算担保金额 $guarantee = PublicController::getDanbaoRate(); $guarantee = $guarantee / 100; $loan_yield = $loan_yield / 100; $danbaoMoney = $loan_money * $guarantee; $userinfo = $this->getUserinfo($this->userid); if (!empty($userinfo)) { $userBalance = $userinfo['f_usermoney']; $frozeBalance = $userinfo['f_frozemoney']; $avaiBalance = floatval($userBalance - $frozeBalance); //$this->userid = $userinfo['f_uid']; } else { $func->showMsg("用户不存在"); } //创建订单 并冻结用户余额(暂不用事务处理) $Loan = D("loan"); $data = array(); $data['f_userid'] = $this->userid; $data['f_money'] = $loan_money; $data['f_horizon'] = $horizon; $data['f_yield'] = $loan_yield; $data['f_danbaomoney'] = $danbaoMoney; $data['f_addtime'] = time(); $res = $Loan->add($data); if (!empty($res)) { $func->showMsg("挂单成功", 1, true, false, U('Invest/index')); } else { $func->showMsg("挂单失败"); } }