Пример #1
0
 public function index()
 {
     $root = array();
     $email = strim($GLOBALS['request']['email']);
     //用户名或邮箱
     $pwd = strim($GLOBALS['request']['pwd']);
     //密码
     //检查用户,用户密码
     $user = user_check($email, $pwd);
     $user_id = intval($user['id']);
     $root['user_id'] = $user_id;
     if ($user_id > 0) {
         require APP_ROOT_PATH . 'app/Lib/uc_func.php';
         $root['user_login_status'] = 1;
         $root['response_code'] = 1;
         $bank_list = $GLOBALS['db']->getAll("SELECT u.id, u.bankcard,u.real_name, b.name as bank_name, b.id as bank_id FROM " . DB_PREFIX . "user_bank u left join " . DB_PREFIX . "bank b on b.id = u.bank_id where u.user_id=" . $user_id . " ORDER BY u.id ASC");
         foreach ($bank_list as $k => $v) {
             $bank_list[$k]['bankcode'] = str_replace(" ", "", $v['bankcard']);
             $bank_list[$k]['img'] = str_replace("/mapi", "", SITE_DOMAIN . APP_ROOT . '/public/bank/' . $v['bank_id'] . '.jpg');
         }
         $root['item'] = $bank_list;
         //手续费
         $fee_config = load_auto_cache("user_carry_config");
         $json_fee = array();
         foreach ($fee_config as $k => $v) {
             $json_fee[] = $v;
             $fee_config[$k]['fee_format'] = format_price($v['fee']);
         }
         $root['fee_config'] = $fee_config;
         //$root['json_fee'] = json_encode($json_fee);
         $root['open_ips'] = intval(app_conf("OPEN_IPS"));
         $root['ips_acct_no'] = $user['ips_acct_no'];
         $root['idno'] = $user['idno'];
         //身份证号
         $root['real_name'] = $user['real_name'];
         //第三方托管标
         if (!empty($user['ips_acct_no']) && intval(app_conf("OPEN_IPS")) > 0) {
             $result = GetIpsUserMoney($user_id, 0);
             $root['ips_money'] = $result['pBalance'];
             //提现 http://p2p.fanwe.net/index.php?ctl=collocation&act=DoDwTrade&user_type=0&from=app&user_id=44&pTrdAmt=10
             $app_url = APP_ROOT . "/index.php?ctl=collocation&act=DoDwTrade&user_type=0&pTrdAmt=parm_amt&user_id=" . $user_id . "&from=" . $GLOBALS['request']['from'];
             $root['dw_url'] = str_replace("/mapi", "", SITE_DOMAIN . $app_url);
         } else {
             //申请
             $app_url = APP_ROOT . "/index.php?ctl=collocation&act=CreateNewAcct&user_type=0&user_id=" . $user_id . "&from=" . $GLOBALS['request']['from'];
             $root['acct_url'] = str_replace("/mapi", "", SITE_DOMAIN . $app_url);
             $root['ips_money'] = 0;
         }
         $root['ips_money_format'] = format_price($root['ips_money']);
         //预留 提现金额
         $root['ips_money_fee'] = 0;
         //预留 提现费用
     } else {
         $root['response_code'] = 0;
         $root['show_err'] = "未登录";
         $root['user_login_status'] = 0;
     }
     $root['program_title'] = "提现";
     output($root);
 }
Пример #2
0
 public function index()
 {
     $manageagency_info = es_session::get("manageagency_info");
     $user_info = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user where id = " . intval($manageagency_info['id']));
     $user_info["money"] = GetIpsUserMoney($user_info["user_id"], $user_info["acct_type"]);
     //$user_info["money"] = array ( "pErrCode" => "0000", "pErrMsg" => "账户余额查询成功" ,"pIpsAcctNo" => 4021000031057078 ,"pBalance" => 1.00 ,"pLock" => 2.00, "pNeedstl" => 3.00 );
     $user_info["total_money"] = $GLOBALS['db']->getOne("select sum(pTrdAmt) from " . DB_PREFIX . "ips_do_dw_trade where user_id = " . intval($manageagency_info['id']) . " and pErrCode = 'MG00000F'");
     $GLOBALS['tmpl']->assign("user_info", $user_info);
     $GLOBALS['tmpl']->assign("inc_file", "manageagency/agency_money_index.html");
     $GLOBALS['tmpl']->display("manageagency/m.html");
 }
Пример #3
0
 public function index()
 {
     $root = array();
     $email = strim($GLOBALS['request']['email']);
     //用户名或邮箱
     $pwd = strim($GLOBALS['request']['pwd']);
     //密码
     $id = intval($GLOBALS['request']['id']);
     $type = intval($GLOBALS['request']['type']);
     //检查用户,用户密码
     $user = user_check($email, $pwd);
     $user_id = intval($user['id']);
     if ($user_id > 0) {
         $root['user_login_status'] = 1;
         $root['response_code'] = 1;
         $root['open_ips'] = intval(app_conf("OPEN_IPS"));
         $root['ips_acct_no'] = $user['ips_acct_no'];
         $root['idno'] = $user['idno'];
         //身份证号
         $root['real_name'] = $user['real_name'];
         $app_url = APP_ROOT . "/index.php?ctl=collocation&act=CreateNewAcct&user_type=0&user_id=" . $user_id . "&from=" . $GLOBALS['request']['from'];
         $root['acct_url'] = str_replace("/mapi", "", SITE_DOMAIN . $app_url);
         if ($type == 0) {
             $deal_id = $id;
         } else {
             if ($type == 1) {
                 $deal_id = $GLOBALS['db']->getOne("SELECT deal_id FROM " . DB_PREFIX . "deal_load_transfer WHERE id = " . $id);
             }
         }
         $ips_bill_no = $GLOBALS['db']->getOne("SELECT ips_bill_no FROM " . DB_PREFIX . "deal WHERE id = " . $deal_id);
         $root['ips_bill_no'] = $ips_bill_no;
         if (!empty($root['ips_bill_no'])) {
             //第三方托管标
             if (!empty($user['ips_acct_no'])) {
                 $result = GetIpsUserMoney($user_id, 0);
                 $root['user_money'] = $result['pBalance'];
             } else {
                 $root['user_money'] = 0;
             }
         } else {
             $root['user_money'] = $user['money'];
         }
         $root['user_money_format'] = format_price($root['user_money']);
         //用户金额
     } else {
         $root['response_code'] = 0;
         $root['show_err'] = "未登录";
         $root['user_login_status'] = 0;
     }
     output($root);
 }
Пример #4
0
 public function index()
 {
     $root = array();
     $id = intval($GLOBALS['request']['id']);
     $email = strim($GLOBALS['request']['email']);
     //用户名或邮箱
     $pwd = strim($GLOBALS['request']['pwd']);
     //密码
     //检查用户,用户密码
     $user = user_check($email, $pwd);
     $user_id = intval($user['id']);
     if ($user_id > 0) {
         $root['is_faved'] = $GLOBALS['db']->getOne("SELECT count(*) FROM " . DB_PREFIX . "deal_collect WHERE deal_id = " . $id . " AND user_id=" . $user_id);
     } else {
         $root['is_faved'] = 0;
         //0:未关注;>0:已关注
     }
     $root['response_code'] = 1;
     $deal = get_deal($id);
     //format_deal_item($deal,$email,$pwd);
     //print_r($deal);
     //exit;
     $root['deal'] = $deal;
     $root['open_ips'] = intval(app_conf("OPEN_IPS"));
     $root['ips_acct_no'] = $user['ips_acct_no'];
     $root['ips_bill_no'] = $deal['ips_bill_no'];
     //		function bid_calculate(){
     //			require_once APP_ROOT_PATH."app/Lib/deal_func.php";
     //			echo bid_calculate($_POST);
     //		}
     if (!empty($root['ips_bill_no'])) {
         //第三方托管标
         if (!empty($user['ips_acct_no'])) {
             $result = GetIpsUserMoney($user_id, 0);
             $root['user_money'] = $result['pBalance'];
         } else {
             $root['user_money'] = 0;
         }
     } else {
         $root['user_money'] = $user['money'];
     }
     $root['user_money_format'] = format_price($user['user_money']);
     //用户金额
     //data.deal.name
     $root['program_title'] = "投标详情";
     output($root);
 }
Пример #5
0
 public function index()
 {
     $root = array();
     $id = intval($GLOBALS['request']['id']);
     $deal_id = intval($GLOBALS['request']['deal_id']);
     $email = strim($GLOBALS['request']['email']);
     //用户名或邮箱
     $pwd = strim($GLOBALS['request']['pwd']);
     //密码
     //检查用户,用户密码
     $user = user_check($email, $pwd);
     $user_id = intval($user['id']);
     if ($user_id > 0) {
         $root['is_faved'] = $GLOBALS['db']->getOne("SELECT count(*) FROM " . DB_PREFIX . "deal_collect WHERE deal_id = " . $id . " AND user_id=" . $user_id);
     } else {
         $root['is_faved'] = 0;
         //0:未关注;>0:已关注
     }
     $root['response_code'] = 1;
     $condition = ' AND dlt.id=' . $id . ' AND d.deal_status >= 4 and d.is_effect=1 and d.is_delete=0  and d.repay_time_type =1 and  d.publish_wait=0 ';
     $union_sql = " LEFT JOIN " . DB_PREFIX . "deal_load_transfer dlt ON dlt.deal_id = dl.deal_id ";
     $transfer = get_transfer($union_sql, $condition);
     $root['transfer'] = $transfer;
     $root['deal_id'] = $deal_id;
     $root['open_ips'] = intval(app_conf("OPEN_IPS"));
     $root['ips_acct_no'] = $user['ips_acct_no'];
     $root['ips_bill_no'] = $GLOBALS['db']->getOne("SELECT ips_bill_no FROM " . DB_PREFIX . "deal WHERE id = " . $deal_id);
     if (!empty($root['ips_bill_no'])) {
         //第三方托管标
         if (!empty($user['ips_acct_no'])) {
             $result = GetIpsUserMoney($user_id, 0);
             $root['user_money'] = $result['pBalance'];
         } else {
             $root['user_money'] = 0;
         }
     } else {
         $root['user_money'] = $user['money'];
     }
     $root['user_money_format'] = format_price($user['user_money']);
     //用户金额
     output($root);
 }
Пример #6
0
 public function index()
 {
     $root = array();
     $email = strim($GLOBALS['request']['email']);
     //用户名或邮箱
     $pwd = strim($GLOBALS['request']['pwd']);
     //密码
     $id = intval($GLOBALS['request']['id']);
     //检查用户,用户密码
     $user = user_check($email, $pwd);
     $user_id = intval($user['id']);
     if ($user_id > 0) {
         $root['user_login_status'] = 1;
         $root['response_code'] = 1;
         $root['is_faved'] = $GLOBALS['db']->getOne("SELECT count(*) FROM " . DB_PREFIX . "deal_collect WHERE deal_id = " . $id . " AND user_id=" . $user_id);
         $root['ips_bill_no'] = $GLOBALS['db']->getOne("SELECT ips_bill_no FROM " . DB_PREFIX . "deal WHERE id = " . $id);
         if (!empty($root['ips_bill_no'])) {
             //第三方托管标
             if (!empty($user['ips_acct_no'])) {
                 $result = GetIpsUserMoney($user_id, 0);
                 $root['user_money'] = $result['pBalance'];
             } else {
                 $root['user_money'] = 0;
             }
         } else {
             $root['user_money'] = $user['money'];
         }
         $root['user_money_format'] = format_price($user['user_money']);
         //用户金额
         $root['open_ips'] = intval(app_conf("OPEN_IPS"));
         $root['ips_acct_no'] = $user['ips_acct_no'];
         //当前用户是否有申请,第三方托管帐户
     } else {
         $root['response_code'] = 0;
         $root['show_err'] = "未登录";
         $root['user_login_status'] = 0;
     }
     output($root);
 }
 public function index()
 {
     $manageagency_info = es_session::get("manageagency_info");
     $user_info = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "deal_agency where id = " . intval($manageagency_info['id']));
     $user_info["money"] = GetIpsUserMoney($user_info["user_id"], $user_info["acct_type"]);
     //$user_info["money"] = array ( "pErrCode" => "0000", "pErrMsg" => "账户余额查询成功" ,"pIpsAcctNo" => 4021000031057078 ,"pBalance" => 1.00 ,"pLock" => 2.00, "pNeedstl" => 3.00 );
     $user_info["total_money"] = $GLOBALS['db']->getOne("select sum(pTrdAmt) from " . DB_PREFIX . "ips_do_dw_trade where user_id = " . intval($manageagency_info['id']) . " and pErrCode = 'MG00000F'");
     $GLOBALS['tmpl']->assign("user_info", $user_info);
     /*$type_title = intval($_REQUEST['type_title']) > 0 ? intval($_REQUEST['type_title']) : 100;
     		
     		$times = intval($_REQUEST['times']);
     		
     		$time_status = intval($_REQUEST['time_status']);
     		
     		$page = intval($_REQUEST['p']);
     		if($page==0)
     			$page = 1;
     		$limit = (($page-1)*app_conf("PAGE_SIZE")).",".app_conf("PAGE_SIZE");
     		
     		
     		
     		$times_array = array(
     				"0" => "全部",
     				"1" => "三天以内",
     				"2" => "一周以内",
     				"3" => "一月以内",
     				"4" => "三月以内",
     				"5" => "一年以内"
     		);
     		$GLOBALS['tmpl']->assign('times_array',$times_array);
     		
     		$user_id = intval($manageagency_info['id']);
     		
     		
     		
     		$condition = "";
     		
     		if ($times== 1){
     			$condition.=" and create_time_ymd >= '".to_date(TIME_UTC-3600*24*3,"Y-m-d")."' "; //三天以内
     		}elseif ($times==2){
     			$condition.="and create_time_ymd >= '".to_date(TIME_UTC - to_date(TIME_UTC,"w") * 24*3600 ,"Y-m-d")."'"; //一周以内
     		}elseif ($times==3){
     			$condition.=" and create_time_ym  = '".to_date(TIME_UTC,"Ym")."'";//一月以内
     		}elseif ($times==4){
     			$condition.=" and create_time_ym  >= '".to_date(next_replay_month(TIME_UTC , -2 ),"Ym" )."'";//三月以内
     		}elseif ($times==5){
     			$condition.=" and create_time_y  = '".to_date(TIME_UTC,"Y")."'";//一年以内
     		}
     		
     		if ($type_title==100)
     		{
     			$type= -1;
     		}
     		else{
     			$type = $type_title;
     		}
     		
     		if($time_status==1){
     			$time = isset($_REQUEST['time']) ? strim($_REQUEST['time']) : "";
     			
     			$time_f = to_date(to_timespan($time,"Ymd"),"Y-m-d");
     			$condition.=" and create_time_ymd = '".$time_f."'";
     			$GLOBALS['tmpl']->assign('time_normal',$time_f);
     			$GLOBALS['tmpl']->assign('time',$time);
     		}
     		
     		if(isset($t) && $t=="point"){
     			$result = get_user_point_log($limit,$user_id,$type,$condition); //会员信用积分
     		}else{
     			$result = get_user_money_log($limit,$user_id,$type,$condition); //会员资金日志
     		}
     		
     		foreach($result['list'] as $k=>$v){
     			$result['list'][$k]['title'] = $title_arrays[$v['type']];
     		}
     		$GLOBALS['tmpl']->assign("type_title",$type_title);
     		$GLOBALS['tmpl']->assign("times",$times);
     		
     		$GLOBALS['tmpl']->assign("carry_money",$GLOBALS['db']->getOne("SELECT sum(money) FROM ".DB_PREFIX."user_carry WHERE user_id=".$user_id." AND `status`=1"));
     		$GLOBALS['tmpl']->assign("incharge_money",$GLOBALS['db']->getOne("SELECT sum(money) FROM ".DB_PREFIX."payment_notice WHERE user_id=".$user_id." AND `is_paid`=1"));
     		$GLOBALS['tmpl']->assign('time_status',$time_status);
     		
     		$GLOBALS['tmpl']->assign("list",$result['list']);
     		$page = new Page($result['count'],app_conf("PAGE_SIZE"));   //初始化分页对象 		
     		$p  =  $page->show();
     		$GLOBALS['tmpl']->assign('pages',$p);
     		
     		$GLOBALS['tmpl']->assign("page_title",$GLOBALS['lang']['UC_MONEY']);*/
     $GLOBALS['tmpl']->assign("inc_file", "manageagency/agency_money_index.html");
     $GLOBALS['tmpl']->display("manageagency/m.html");
 }
 /**
 * 账户余额查询(WS)
 * @param int $user_id
 * @param int $user_type 0:普通用户fanwe_user.id;1:担保用户fanwe_deal_agency.id
 * @param unknown_type $MerCode
 * @param unknown_type $cert_md5
 * @param unknown_type $ws_url
 * @return	 
 			 pErrCode 4 返回状态 否 0000成功; 9999失败;
 			 pErrMsg 100 返回信息 否 状态0000:成功 除此乊外:反馈实际原因
 			 pIpsAcctNo 30 IPS账户号 否 查询时提交
 			 pBalance 10 可用余额 否 带正负符号,带小数点,最多保留两位小数
 			 pLock 10 冻结余额 否 带正负符号,带小数点,最多保留两位小数
 			 pNeedstl 10 未结算余额 否 带正负符号,带小数点,最多保留两位小数
 */
 public function QueryForAccBalance()
 {
     $user_id = intval(strim($_REQUEST['user_id']));
     $user_type = intval(strim($_REQUEST['user_type']));
     $is_ajax = intval(strim($_REQUEST['is_ajax']));
     $data = array();
     if (true) {
         $data = $GLOBALS['db']->getRow("select id,ips_acct_no from " . DB_PREFIX . "user where id = " . $user_id);
         $argIpsAccount = $data['ips_acct_no'];
     } else {
         $data = $GLOBALS['db']->getRow("select id,ips_acct_no,is_investor,ips_mer_code from " . DB_PREFIX . "user where id = " . $user_id);
         //acct_type 担保方类型 否 0#机构;1#个人
         if ($data['is_investor'] == 2) {
             $argIpsAccount = $data['ips_mer_code'];
         } else {
             $argIpsAccount = $data['ips_acct_no'];
         }
     }
     if (empty($data)) {
         showErr('用户不存在', $is_ajax);
     } else {
         if (!empty($data['ips_acct_no'])) {
             $result = GetIpsUserMoney($user_id, $user_type);
             foreach ($result as $k => $v) {
                 if ($k == "pNeedstl" || $k == "pBalance" || $k == "pLock") {
                     $result[$k] = round($v, 2);
                 }
             }
             if ($is_ajax == 1) {
                 ajax_return($result);
             } else {
                 print_r($result);
             }
         } else {
             showErr('该用户还未申请过资金托管帐户', $is_ajax);
         }
     }
 }
 public function index()
 {
     $root = array();
     $email = strim($GLOBALS['request']['email']);
     //用户名或邮箱
     $pwd = strim($GLOBALS['request']['pwd']);
     //密码
     //检查用户,用户密码
     $user = user_check($email, $pwd);
     $user_id = intval($user['id']);
     if ($user_id > 0) {
         $root['user_login_status'] = 1;
         $user['group_name'] = $GLOBALS['db']->getOne("select name from " . DB_PREFIX . "user_group where id = " . $user['group_id'] . " ");
         $province_str = $GLOBALS['db']->getOne("select name from " . DB_PREFIX . "region_conf where id = " . $user['province_id']);
         $city_str = $GLOBALS['db']->getOne("select name from " . DB_PREFIX . "region_conf where id = " . $user['city_id']);
         if ($province_str . $city_str == '') {
             $user_location = $GLOBALS['lang']['LOCATION_NULL'];
         } else {
             $user_location = $province_str . " " . $city_str;
         }
         $user['user_location'] = $user_location;
         $user['money_format'] = format_price($user['money']);
         //可用资金
         $user['lock_money_format'] = format_price($user['lock_money']);
         //冻结资金
         $user['total_money'] = intval($user['money']) + intval($user['lock_money']);
         //资金余额
         $user['total_money_format'] = format_price($user['total_money']);
         //资金余额
         $user['create_time_format'] = to_date($user['create_time'], 'Y-m-d');
         //注册时间
         $root['response_code'] = 1;
         $root['user_location'] = $user['user_location'];
         $root['user_name'] = $user['user_name'];
         $root['group_name'] = $user['group_name'];
         $root['money_format'] = $user['money_format'];
         $root['money'] = $user['money'];
         $root['lock_money_format'] = $user['lock_money_format'];
         $root['lock_money'] = $user['lock_money'];
         $root['total_money'] = $user['total_money'];
         $root['total_money_format'] = $user['total_money_format'];
         $root['create_time_format'] = $user['create_time_format'];
         $root['idno'] = $user['idno'];
         $root['real_name'] = $user['real_name'];
         if (intval(app_conf("OPEN_IPS")) > 0) {
             $app_url = APP_ROOT . "/index.php?ctl=collocation&act=CreateNewAcct&user_type=0&user_id=" . $user_id . "&from=" . $GLOBALS['request']['from'];
             //申请
             $root['app_url'] = str_replace("/mapi", "", SITE_DOMAIN . $app_url);
             $root['acct_url'] = $root['app_url'];
         }
         $root['ips_acct_no'] = $user['ips_acct_no'];
         $root['open_ips'] = intval(app_conf("OPEN_IPS"));
         //第三方托管标
         if (!empty($user['ips_acct_no']) && intval(app_conf("OPEN_IPS")) > 0) {
             $result = GetIpsUserMoney($user_id, 0);
             $root['ips_balance'] = $result['pBalance'];
             //可用余额
             $root['ips_lock'] = $result['pLock'];
             //冻结余额
             $root['ips_needstl'] = $result['pNeedstl'];
             //未结算余额
         } else {
             $root['ips_balance'] = 0;
             //可用余额
             $root['ips_lock'] = 0;
             //冻结余额
             $root['ips_needstl'] = 0;
             //未结算余额
         }
         $root['ips_balance_format'] = format_price($root['ips_balance']);
         $root['ips_lock_format'] = format_price($root['ips_lock']);
         $root['ips_needstl_format'] = format_price($root['ips_needstl']);
     } else {
         $root['response_code'] = 0;
         $root['show_err'] = "未登录";
         $root['user_login_status'] = 0;
     }
     $root['program_title'] = "会员中心";
     output($root);
 }
 /**
 * 账户余额查询(WS)
 * @param int $user_id
 * @param int $user_type 0:普通用户xd_user.id;1:担保用户xd_deal_agency.id
 * @param unknown_type $MerCode
 * @param unknown_type $cert_md5
 * @param unknown_type $ws_url
 * @return	 
 			 pErrCode 4 返回状态 否 0000成功; 9999失败;
 			 pErrMsg 100 返回信息 否 状态0000:成功 除此乊外:反馈实际原因
 			 pIpsAcctNo 30 IPS账户号 否 查询时提交
 			 pBalance 10 可用余额 否 带正负符号,带小数点,最多保留两位小数
 			 pLock 10 冻结余额 否 带正负符号,带小数点,最多保留两位小数
 			 pNeedstl 10 未结算余额 否 带正负符号,带小数点,最多保留两位小数
 */
 public function QueryForAccBalance()
 {
     $user_id = intval(strim($_REQUEST['user_id']));
     $user_type = intval(strim($_REQUEST['user_type']));
     $is_ajax = intval(strim($_REQUEST['is_ajax']));
     $data = array();
     if ($user_type == 0) {
         $data = $GLOBALS['db']->getRow("select id,ips_acct_no from " . DB_PREFIX . "user where id = " . $user_id);
         $argIpsAccount = $data['ips_acct_no'];
     } else {
         $data = $GLOBALS['db']->getRow("select id,ips_acct_no,acct_type,ips_mer_code from " . DB_PREFIX . "deal_agency where id = " . $user_id);
         //acct_type 担保方类型 否 0#机构;1#个人
         if ($data['acct_type'] == 0) {
             $argIpsAccount = $data['ips_mer_code'];
         } else {
             $argIpsAccount = $data['ips_acct_no'];
         }
     }
     if (empty($data)) {
         showErr('用户不存在', $is_ajax);
     } else {
         if (!empty($data['ips_acct_no'])) {
             $result = GetIpsUserMoney($user_id, $user_type);
             if ($is_ajax == 1) {
                 ajax_return($result);
             } else {
                 print_r($result);
             }
         } else {
             showErr('该用户还未申请过资金托管帐户', $is_ajax);
         }
     }
 }