Ejemplo n.º 1
0
 public function __construct()
 {
     if (in_array(ACTION_NAME, array("carry", "savecarry"))) {
         $is_ajax = intval($_REQUEST['is_ajax']);
         //判断是否是黑名单会员
         if ($GLOBALS['user_info']['is_black'] == 1) {
             showErr("您当前无权限提现,具体联系网站客服", $is_ajax, url("index", "uc_center"));
         }
     }
     if (file_exists(APP_ROOT_PATH . "public/uc_config.php")) {
         require_once APP_ROOT_PATH . "public/uc_config.php";
     }
     if (app_conf("INTEGRATE_CODE") == 'Ucenter' && UC_CONNECT == 'mysql') {
         if (file_exists(APP_ROOT_PATH . "public/uc_data/creditsettings.php")) {
             require_once APP_ROOT_PATH . "public/uc_data/creditsettings.php";
             $this->creditsettings = $_CACHE['creditsettings'];
             if (count($this->creditsettings) > 0) {
                 foreach ($this->creditsettings as $k => $v) {
                     $this->creditsettings[$k]['srctitle'] = $this->credits_CFG[$v['creditsrc']]['title'];
                 }
                 $this->allow_exchange = true;
                 $GLOBALS['tmpl']->assign("allow_exchange", $this->allow_exchange);
             }
         }
     }
     parent::__construct();
 }
Ejemplo n.º 2
0
 public function __construct()
 {
     parent::__construct();
     if (!check_hash_key()) {
         showErr("非法请求!", 1);
     }
 }
 public function __construct()
 {
     parent::__construct();
     if (ACTION_NAME == "index" || ACTION_NAME == "buys") {
         //可以转让
         $list_sql = 'SELECT count(DISTINCT (CONCAT(d.id ,"_",dr.u_key))) as rs_count,sum(dr.self_money) as need_transfer_benjin,sum(dr.repay_money - dr.self_money) as need_transfer_lixi FROM ' . DB_PREFIX . 'deal_load_repay dr LEFT JOIN ' . DB_PREFIX . 'deal d ON d.id = dr.deal_id LEFT JOIN ' . DB_PREFIX . 'deal_load_transfer dlt ON dlt.deal_id = dr.deal_id and dlt.load_id=dr.load_id WHERE dr.has_repay =0 and d.repay_time_type =1 and dr.user_id=' . intval($GLOBALS['user_info']['id']) . ' AND d.deal_status = 4 and (isnull(dlt.user_id) or dlt.status=0)  and (d.next_repay_time + + 24*3600 - 1) >' . TIME_UTC;
         $can_rs = $GLOBALS['db']->getRow($list_sql);
         $statics['need_transfer'] = $can_rs['rs_count'];
         //待回收本金
         $statics['need_transfer_benjin'] = $can_rs['need_transfer_benjin'];
         //待回收利息
         $statics['need_transfer_lixi'] = $can_rs['need_transfer_lixi'];
         //转让中
         $list_sql = 'SELECT count(DISTINCT (CONCAT(d.id ,"_",dr.u_key))) as rs_count,sum(dr.self_money) as in_transfer_benjin,sum(dr.repay_money - dr.self_money) as in_transfer_lixi FROM ' . DB_PREFIX . 'deal_load_repay dr LEFT JOIN ' . DB_PREFIX . 'deal d ON d.id = dr.deal_id LEFT JOIN ' . DB_PREFIX . 'deal_load_transfer dlt ON dlt.deal_id = dr.deal_id and dlt.load_id=dr.load_id WHERE dr.has_repay =0 and d.repay_time_type =1 and dr.user_id=' . intval($GLOBALS['user_info']['id']) . ' AND d.deal_status = 4 and dr.t_user_id = 0 and  dlt.status=1  and (d.next_repay_time + + 24*3600 - 1) >' . TIME_UTC;
         $in_rs = $GLOBALS['db']->getRow($list_sql);
         $statics['in_transfer'] = $in_rs['rs_count'];
         //待回收本金
         $statics['in_transfer_benjin'] = $in_rs['in_transfer_benjin'];
         //待回收利息
         $statics['in_transfer_lixi'] = $in_rs['in_transfer_lixi'];
         //回收中
         $list_sql = 'SELECT count(DISTINCT (CONCAT(d.id ,"_",dr.u_key))) as rs_count,sum(dr.self_money) as inback_transfer_benjin,sum(dr.repay_money - dr.self_money) as inback_transfer_lixi FROM ' . DB_PREFIX . 'deal_load_repay dr LEFT JOIN ' . DB_PREFIX . 'deal d ON d.id = dr.deal_id LEFT JOIN ' . DB_PREFIX . 'deal_load_transfer dlt ON dlt.deal_id = dr.deal_id and dlt.load_id=dr.load_id WHERE dr.has_repay =0 and d.repay_time_type =1 AND d.deal_status = 4 and dlt.t_user_id = ' . intval($GLOBALS['user_info']['id']) . '  ';
         $inback_rs = $GLOBALS['db']->getRow($list_sql);
         $statics['inback_transfer'] = $inback_rs['rs_count'];
         $statics['inback_transfer_benjin'] = $inback_rs['inback_transfer_benjin'];
         $statics['inback_transfer_lixi'] = $inback_rs['inback_transfer_lixi'];
         //已回收
         $list_sql = 'SELECT count(DISTINCT (CONCAT(d.id ,"_",dr.u_key))) as rs_count,sum(dr.repay_money) as hasback_transfer_all FROM ' . DB_PREFIX . 'deal_load_repay dr LEFT JOIN ' . DB_PREFIX . 'deal d ON d.id = dr.deal_id LEFT JOIN ' . DB_PREFIX . 'deal_load_transfer dlt ON dlt.deal_id = dr.deal_id and dlt.load_id=dr.load_id WHERE dr.has_repay =1 and d.repay_time_type =1 AND d.deal_status = 5 and dr.repay_time >=dlt.near_repay_time AND dlt.t_user_id = ' . intval($GLOBALS['user_info']['id']) . '  ';
         $hasback_rs = $GLOBALS['db']->getRow($list_sql);
         $statics['hasback_transfer'] = $hasback_rs['rs_count'];
         $statics['hasback_transfer_all'] = $hasback_rs['hasback_transfer_all'];
         $GLOBALS['tmpl']->assign("statics", $statics);
     }
 }
 public function __construct()
 {
     $manageagency_info = es_session::get("manageagency_info");
     $GLOBALS['tmpl']->assign("manageagency_info", $manageagency_info);
     if (!$manageagency_info) {
         app_redirect(url("index", "manageagency#login"));
         die;
     }
     parent::__construct();
 }
Ejemplo n.º 5
0
 function __construct()
 {
     if (in_array(ACTION_NAME, array("index", "quota_submit", "savedealquota", "stepone", "steptwo", "savedeal"))) {
         $is_ajax = intval($_REQUEST['is_ajax']);
         //判断是否是黑名单会员
         if ($GLOBALS['user_info']['is_black'] == 1) {
             showErr("您当前无权限贷款,具体联系网站客服", $is_ajax, url("index"));
         }
     }
     parent::__construct();
 }
Ejemplo n.º 6
0
 public function __construct()
 {
     if (file_exists(APP_ROOT_PATH . "public/uc_config.php")) {
         require_once APP_ROOT_PATH . "public/uc_config.php";
     }
     if (app_conf("INTEGRATE_CODE") == 'Ucenter' && UC_CONNECT == 'mysql') {
         if (file_exists(APP_ROOT_PATH . "public/uc_data/creditsettings.php")) {
             require_once APP_ROOT_PATH . "public/uc_data/creditsettings.php";
             $this->creditsettings = $_CACHE['creditsettings'];
             if (count($this->creditsettings) > 0) {
                 foreach ($this->creditsettings as $k => $v) {
                     $this->creditsettings[$k]['srctitle'] = $this->credits_CFG[$v['creditsrc']]['title'];
                 }
                 $this->allow_exchange = true;
                 $GLOBALS['tmpl']->assign("allow_exchange", $this->allow_exchange);
             }
         }
     }
     parent::__construct();
 }
Ejemplo n.º 7
0
 public function __construct()
 {
     parent::__construct();
     if (ACTION_NAME == "index" || ACTION_NAME == "buys") {
         //可以转让
         $count_sql = 'SELECT count(dl.id) FROM ' . DB_PREFIX . 'deal_load dl LEFT JOIN ' . DB_PREFIX . 'deal d ON d.id = dl.deal_id LEFT JOIN ' . DB_PREFIX . 'deal_load_transfer dlt ON dlt.deal_id = dl.deal_id and dlt.load_id=dl.id WHERE 1=1 and d.is_effect=1 and d.is_delete=0 and d.loantype = 0 and d.repay_time_type =1 and d.publish_wait=0 and dl.user_id=' . intval($GLOBALS['user_info']['id']) . ' AND d.deal_status = 4 and isnull(dlt.id) and d.next_repay_time - ' . TIME_UTC . ' + 24*3600 - 1 > 0 ';
         $rs_count = $GLOBALS['db']->getOne($count_sql);
         $statics['need_transfer'] = $rs_count;
         //待回收本金
         $statics['need_transfer_benjin'] = 0;
         //待回收利息
         $statics['need_transfer_lixi'] = 0;
         if ($statics['need_transfer'] > 0) {
             $list_sql = 'SELECT dl.id as dlid,d.*,dl.money as load_money,dlt.id as dltid,dlt.status as tras_status,dlt.t_user_id,dlt.transfer_amount,dlt.create_time as tras_create_time FROM ' . DB_PREFIX . 'deal_load dl LEFT JOIN ' . DB_PREFIX . 'deal d ON d.id = dl.deal_id LEFT JOIN ' . DB_PREFIX . 'deal_load_transfer dlt ON dlt.deal_id = dl.deal_id and dlt.load_id=dl.id WHERE 1=1 and d.is_effect=1 and d.is_delete=0 and d.loantype = 0 and d.repay_time_type =1 and d.publish_wait=0 and dl.user_id=' . intval($GLOBALS['user_info']['id']) . ' AND d.deal_status = 4 and isnull(dlt.id) and d.next_repay_time - ' . TIME_UTC . ' + 24*3600 - 1 > 0 ';
             $list = $GLOBALS['db']->getAll($list_sql);
             foreach ($list as $k => $v) {
                 //最后还款日
                 $list[$k]['final_repay_time'] = next_replay_month($v['repay_start_time'], $v['repay_time']);
                 //剩余期数
                 if (intval($v['last_repay_time']) > 0) {
                     $list[$k]['how_much_month'] = how_much_month($v['last_repay_time'], $list[$k]['final_repay_time']);
                 } else {
                     $list[$k]['how_much_month'] = how_much_month($v['repay_start_time'], $list[$k]['final_repay_time']);
                 }
                 //本息还款金额
                 $list[$k]['month_repay_money'] = pl_it_formula($v['load_money'], $v['rate'] / 12 / 100, $v['repay_time']);
                 //剩余多少钱未回
                 $list[$k]['all_must_repay_money'] = $list[$k]['month_repay_money'] * $list[$k]['how_much_month'];
                 //剩余多少本金未回
                 $list[$k]['left_benjin'] = get_benjin($v['repay_time'] - $list[$k]['how_much_month'] - 1, $v['repay_time'], $v['load_money'], $list[$k]['month_repay_money'], $v['rate']);
                 $statics['need_transfer_benjin'] += $list[$k]['left_benjin'];
                 //剩多少利息
                 $list[$k]['left_lixi'] = $list[$k]['all_must_repay_money'] - $list[$k]['left_benjin'];
                 $statics['need_transfer_lixi'] += $list[$k]['left_lixi'];
             }
             unset($list);
         }
         //转让中
         $count_sql = 'SELECT count(dl.id) FROM ' . DB_PREFIX . 'deal_load dl LEFT JOIN ' . DB_PREFIX . 'deal d ON d.id = dl.deal_id LEFT JOIN ' . DB_PREFIX . 'deal_load_transfer dlt ON dlt.deal_id = dl.deal_id and dlt.load_id=dl.id WHERE 1=1 and d.is_effect=1 and d.is_delete=0 and d.loantype = 0 and d.repay_time_type =1 and d.publish_wait=0 and dl.user_id=' . intval($GLOBALS['user_info']['id']) . ' AND d.deal_status = 4  AND dlt.status = 1 and dlt.user_id >0 and dlt.t_user_id=0';
         $rs_count = $GLOBALS['db']->getOne($count_sql);
         $statics['in_transfer'] = $rs_count;
         //待回收本金
         $statics['in_transfer_benjin'] = 0;
         //待回收利息
         $statics['in_transfer_lixi'] = 0;
         if ($statics['in_transfer'] > 0) {
             $list_sql = 'SELECT dl.id as dlid,d.*,dl.money as load_money,dlt.id as dltid,dlt.status as tras_status,dlt.t_user_id,dlt.transfer_amount,dlt.create_time as tras_create_time FROM ' . DB_PREFIX . 'deal_load dl LEFT JOIN ' . DB_PREFIX . 'deal d ON d.id = dl.deal_id LEFT JOIN ' . DB_PREFIX . 'deal_load_transfer dlt ON dlt.deal_id = dl.deal_id and dlt.load_id=dl.id WHERE 1=1 and d.is_effect=1 and d.is_delete=0 and d.loantype = 0 and d.repay_time_type =1 and d.publish_wait=0 and dl.user_id=' . intval($GLOBALS['user_info']['id']) . ' AND d.deal_status = 4 AND dlt.status = 1 and dlt.user_id >0 and dlt.t_user_id=0';
             $list = $GLOBALS['db']->getAll($list_sql);
             foreach ($list as $k => $v) {
                 //最后还款日
                 $list[$k]['final_repay_time'] = next_replay_month($v['repay_start_time'], $v['repay_time']);
                 //剩余期数
                 if (intval($v['last_repay_time']) > 0) {
                     $list[$k]['how_much_month'] = how_much_month($v['last_repay_time'], $list[$k]['final_repay_time']);
                 } else {
                     $list[$k]['how_much_month'] = how_much_month($v['repay_start_time'], $list[$k]['final_repay_time']);
                 }
                 //本息还款金额
                 $list[$k]['month_repay_money'] = pl_it_formula($v['load_money'], $v['rate'] / 12 / 100, $v['repay_time']);
                 //剩余多少钱未回
                 $list[$k]['all_must_repay_money'] = $list[$k]['month_repay_money'] * $list[$k]['how_much_month'];
                 //剩余多少本金未回
                 $list[$k]['left_benjin'] = get_benjin($v['repay_time'] - $list[$k]['how_much_month'] - 1, $v['repay_time'], $v['load_money'], $list[$k]['month_repay_money'], $v['rate']);
                 $statics['in_transfer_benjin'] += $list[$k]['left_benjin'];
                 //剩多少利息
                 $list[$k]['left_lixi'] = $list[$k]['all_must_repay_money'] - $list[$k]['left_benjin'];
                 $statics['in_transfer_lixi'] += $list[$k]['left_lixi'];
             }
             unset($list);
         }
         //回收中
         $count_sql = 'SELECT count(DISTINCT dlt.id) FROM ' . DB_PREFIX . 'deal_load_transfer dlt LEFT JOIN ' . DB_PREFIX . 'deal_load dl ON dlt.deal_id = dl.deal_id LEFT JOIN ' . DB_PREFIX . 'deal d ON d.id = dl.deal_id  WHERE 1=1 and d.is_effect=1 and d.is_delete=0 and d.loantype = 0 and d.repay_time_type =1 and d.publish_wait=0 and dlt.t_user_id=' . intval($GLOBALS['user_info']['id']) . ' AND d.deal_status = 4  and dlt.status = 1 ';
         $rs_count = $GLOBALS['db']->getOne($count_sql);
         $statics['inback_transfer'] = $rs_count;
         $statics['inback_transfer_benjin'] = 0;
         $statics['inback_transfer_lixi'] = 0;
         if ($statics['inback_transfer'] > 0) {
             $list_sql = 'SELECT dl.id as dlid,d.*,dl.money as load_money,dlt.id as dltid,dlt.status as tras_status,dlt.t_user_id,dlt.transfer_amount,dlt.create_time as tras_create_time,dlt.transfer_time FROM ' . DB_PREFIX . 'deal_load dl LEFT JOIN ' . DB_PREFIX . 'deal d ON d.id = dl.deal_id LEFT JOIN ' . DB_PREFIX . 'deal_load_transfer dlt ON dlt.deal_id = dl.deal_id WHERE 1=1 and d.is_effect=1 and d.is_delete=0 and d.loantype = 0 and d.repay_time_type =1 and d.publish_wait=0 and dlt.t_user_id=' . intval($GLOBALS['user_info']['id']) . ' AND d.deal_status = 4';
             $list = $GLOBALS['db']->getAll($list_sql);
             foreach ($list as $k => $v) {
                 //最后还款日
                 $list[$k]['final_repay_time'] = next_replay_month($v['repay_start_time'], $v['repay_time']);
                 //剩余期数
                 if (intval($v['last_repay_time']) > 0) {
                     $list[$k]['how_much_month'] = how_much_month($v['last_repay_time'], $list[$k]['final_repay_time']);
                 } else {
                     $list[$k]['how_much_month'] = how_much_month($v['repay_start_time'], $list[$k]['final_repay_time']);
                 }
                 //本息还款金额
                 $list[$k]['month_repay_money'] = pl_it_formula($v['load_money'], $v['rate'] / 12 / 100, $v['repay_time']);
                 //剩余多少钱未回
                 $list[$k]['all_must_repay_money'] = $list[$k]['month_repay_money'] * $list[$k]['how_much_month'];
                 //剩余多少本金未回
                 $list[$k]['left_benjin'] = get_benjin($v['repay_time'] - $list[$k]['how_much_month'] - 1, $v['repay_time'], $v['load_money'], $list[$k]['month_repay_money'], $v['rate']);
                 $statics['inback_transfer_benjin'] += $list[$k]['left_benjin'];
                 //剩多少利息
                 $list[$k]['left_lixi'] = $list[$k]['all_must_repay_money'] - $list[$k]['left_benjin'];
                 $statics['inback_transfer_lixi'] += $list[$k]['left_lixi'];
             }
             unset($list);
         }
         //已回收
         $count_sql = 'SELECT count(dl.id) FROM ' . DB_PREFIX . 'deal_load dl LEFT JOIN ' . DB_PREFIX . 'deal d ON d.id = dl.deal_id LEFT JOIN ' . DB_PREFIX . 'deal_load_transfer dlt ON dlt.deal_id = dl.deal_id WHERE 1=1 and d.is_effect=1 and d.is_delete=0 and d.loantype = 0 and d.repay_time_type =1 and d.publish_wait=0 and dlt.t_user_id=' . intval($GLOBALS['user_info']['id']) . ' AND d.deal_status = 5';
         $rs_count = $GLOBALS['db']->getOne($count_sql);
         $statics['hasback_transfer'] = $rs_count;
         $statics['hasback_transfer_all'] = 0;
         if ($statics['hasback_transfer'] > 0) {
             $list_sql = 'SELECT dl.id as dlid,d.*,dl.money as load_money,dlt.id as dltid,dlt.status as tras_status,dlt.t_user_id,dlt.transfer_amount,dlt.create_time as tras_create_time,dlt.transfer_time,dlt.near_repay_time FROM ' . DB_PREFIX . 'deal_load dl LEFT JOIN ' . DB_PREFIX . 'deal d ON d.id = dl.deal_id LEFT JOIN ' . DB_PREFIX . 'deal_load_transfer dlt ON dlt.deal_id = dl.deal_id WHERE 1=1 and d.is_effect=1 and d.is_delete=0 and d.loantype = 0 and d.repay_time_type =1 and d.publish_wait=0 and dlt.t_user_id=' . intval($GLOBALS['user_info']['id']) . ' AND d.deal_status = 5';
             $list = $GLOBALS['db']->getAll($list_sql);
             foreach ($list as $k => $v) {
                 //最后还款日
                 $list[$k]['final_repay_time'] = next_replay_month($v['repay_start_time'], $v['repay_time']);
                 //剩余期数
                 $list[$k]['how_much_month'] = how_much_month($v['near_repay_time'], $list[$k]['final_repay_time']) + 1;
                 //本息还款金额
                 $list[$k]['month_repay_money'] = pl_it_formula($v['load_money'], $v['rate'] / 12 / 100, $v['repay_time']);
                 //剩余多少钱未回
                 $list[$k]['all_must_repay_money'] = $list[$k]['month_repay_money'] * $list[$k]['how_much_month'];
                 $statics['hasback_transfer_all'] += $list[$k]['all_must_repay_money'];
                 //剩余多少本金未回
                 //$list[$k]['left_benjin'] = get_benjin($v['repay_time']-$list[$k]['how_much_month']-1,$v['repay_time'],$v['load_money'],$list[$k]['month_repay_money'],$v['rate']);
                 //剩多少利息
                 //$list[$k]['left_lixi'] = $list[$k]['all_must_repay_money'] - $list[$k]['left_benjin'];
             }
             unset($list);
         }
         $GLOBALS['tmpl']->assign("statics", $statics);
     }
 }
 function __construct()
 {
     parent::__construct();
     $this->autobid();
 }