<?php
// +----------------------------------------------------------------------
// | Fanwe 方维p2p借贷系统
// +----------------------------------------------------------------------
// | Copyright (c) 2011 http://www.fanwe.com All rights reserved.
// +----------------------------------------------------------------------
// | Author: 云淡风轻(88522820@qq.com)
// +----------------------------------------------------------------------
/**
* 获取指定的投标
*/
function get_deal($id=0,$is_effect=1)
{
$time = TIME_UTC;
if($is_effect == 1)
{
$ext = " and is_effect = 1 ";
}
if($id==0) //有ID时不自动获取
{
return false;
/*$sql = "select id from ".DB_PREFIX."deal where is_effect = 1 and is_delete = 0 ";
if($cate_id>0)
{
$ids =load_auto_cache("deal_sub_parent_cate_ids",array("cate_id"=>$cate_id));
$sql .= " and cate_id in (".implode(",",$ids).")";
}
$sql.=" order by sort desc";
$deal = $GLOBALS['db']->getRow($sql);
*/
}
else{
$deal = $GLOBALS['db']->getRow("select * from ".DB_PREFIX."deal where id = ".intval($id)." and is_delete <> 1 $ext");
}
if($deal)
{
if($deal['deal_status']!=3 && $deal['deal_status']!=5)
{
$temp_data =syn_deal_status($deal['id']);
$deal = array_merge($deal,$temp_data);
}
format_deal_item($deal);
}
return $deal;
}
/**
* 获取正在进行的投标列表
*/
function get_deal_list($limit="",$cate_id=0, $where='',$orderby = '',$user_name='',$user_pwd='',$is_all=false)
{
$time = TIME_UTC;
$count_sql = "select count(*) from ".DB_PREFIX."deal where 1=1 ";
if($is_all==false)
$count_sql.=" and is_effect = 1 and is_delete = 0 ";
if(es_cookie::get("shop_sort_field")=="ulevel"){
$extfield = ",(SELECT u.level_id FROM fanwe_user u WHERE u.id=user_id ) as ulevel";
}
$sql = "select *,start_time as last_time,(load_money/borrow_amount*100) as progress_point,(start_time + enddate*24*3600 - ".$time.") as remain_time $extfield from ".DB_PREFIX."deal where 1 = 1 ";
if($is_all==false)
$sql.=" and is_effect = 1 and is_delete = 0 ";
if($cate_id>0)
{
$ids =load_auto_cache("deal_sub_parent_cate_ids",array("cate_id"=>$cate_id));
$sql .= " and cate_id in (".implode(",",$ids).")";
$count_sql .= " and cate_id in (".implode(",",$ids).")";
}
if($where != '')
{
$sql.=" and ".$where;
$count_sql.=" and ".$where;
}
if($orderby=='')
$sql.=" order by sort desc ";
else
$sql.=" order by ".$orderby;
if($limit!=""){
$sql .=" limit ".$limit;
}
$deals_count = $GLOBALS['db']->getOne($count_sql);
if($deals_count > 0){
$deals = $GLOBALS['db']->getAll($sql);
//echo $sql;
if($deals)
{
foreach($deals as $k=>$deal)
{
format_deal_item($deal,$user_name,$user_pwd);
$deals[$k] = $deal;
}
}
}
else{
$deals = array();
}
return array('list'=>$deals,'count'=>$deals_count);
}
function format_deal_item(&$deal,$user_name="",$user_pwd=""){
//判断是否已经开始
$deal['is_wait'] = 0;
if($deal['start_time'] > TIME_UTC){
$deal['is_wait'] = 1;
$deal['remain_time'] = $deal['start_time'] - TIME_UTC;
}
else{
$deal['remain_time'] = $deal['start_time'] + $deal['enddate']*24*3600 - TIME_UTC;
}
//当为天的时候
if($deal['repay_time_type'] == 0){
$true_repay_time = 1;
}
else{
$true_repay_time = $deal['repay_time'];
}
if(trim($deal['titlecolor']) != ''){
$deal['color_name'] = "<span style='color:#".$deal['titlecolor']."'>".$deal['name']."</span>";
}
else{
$deal['color_name'] = $deal['name'];
}
$jkr['user_name'] = $GLOBALS['db']->getOne("select user_name,id from ".DB_PREFIX."user where id=".$deal['user_id']);
$deal['uname'] = $jkr['user_name'];
//格式化数据
if($deal['apart_borrow_amount'])
$deal['borrow_amount_format'] = format_price($deal['apart_borrow_amount']/10000)."万";
else
$deal['borrow_amount_format'] = format_price($deal['borrow_amount']/10000)."万";
$deal['load_money_format'] = format_price($deal['load_money']/10000)."万";
$deal['rate_foramt'] = number_format($deal['rate'],2);
$deal['create_time_format'] = to_date($deal['create_time'],'Y-m-d');
//$deal['borrow_amount_format_w'] = format_price($deal['borrow_amount']/10000)."万";
$deal['rate_foramt_w'] = number_format($deal['rate'],2)."%";
$deal_repay_rs = deal_repay_money($deal);
//本息还款金额
$deal['month_repay_money'] = $deal_repay_rs['month_repay_money'];
//最后一期还款
$deal['last_month_repay_money'] = $deal_repay_rs['last_month_repay_money'];
$deal['month_repay_money_format'] = format_price($deal['month_repay_money']);
//到期还本息管理费
$deal['month_manage_money'] = $deal['borrow_amount']*(float)$deal['manage_fee']/100;
$deal['month_manage_money_format'] = format_price($deal['month_manage_money']);
//总的多少管理费
if($deal['repay_time_type']==1)
$deal['all_manage_money'] = $deal['month_manage_money'] * $deal["repay_time"];
else
$deal['all_manage_money'] = $deal['month_manage_money'] ;
if(is_last_repay($deal['loantype'])){
$deal['true_month_repay_money'] = $deal['month_repay_money'] + $deal['all_manage_money'];
$deal['true_last_month_repay_money'] = $deal['last_month_repay_money'] + $deal['all_manage_money'];
}
else{
$deal['true_month_repay_money'] = $deal['month_repay_money'] + $deal['month_manage_money'];
$deal['true_last_month_repay_money'] = $deal['last_month_repay_money'] + $deal['month_manage_money'];
}
$deal['true_month_repay_money_format'] = format_price($deal['true_month_repay_money']);
//还需多少钱
$deal['need_money'] = format_price($deal['borrow_amount'] - $deal['load_money']);
//百分比
$deal['progress_point'] = $deal['load_money']/$deal['borrow_amount']*100;
$deal['user'] = get_user("*",$deal['user_id']);
if($deal['cate_id'] > 0){
$deal['cate_info'] = $GLOBALS['db']->getRow("select id,name,brief,uname,icon from ".DB_PREFIX."deal_cate where id = ".$deal['cate_id']." and is_effect = 1 and is_delete = 0",false);
}
if($deal['type_id'] > 0){
$deal['type_info'] = get_loantype_info($deal['type_id']);
if($deal['deal_status'] == 0){
$deal['need_credit'] = 0; //0不需要材料,1需要材料
$credits = unserialize($deal['type_info']['credits']);
$user_credit = get_user_credit_file($deal['user_id']);
foreach($credits as $kk=>$vv){
if($user_credit[$vv]['passed']==0){
$deal['need_credit'] += 1;
}
}
}
}
if($deal['agency_id'] > 0){
$deal['agency_info'] = get_user("*",$deal['agency_id']);
if($deal['agency_info']['view_info']!=""){
$deal['agency_info']['view_info_list'] = unserialize($deal['agency_info']['view_info']);
}
}
if($deal['deal_status'] <> 1 || $deal['remain_time'] <= 0){
$deal['remain_time_format'] = "0".$GLOBALS['lang']['DAY']."0".$GLOBALS['lang']['HOUR']."0".$GLOBALS['lang']['MIN'];
}
else{
$deal['remain_time_format'] = remain_time($deal['remain_time']);
}
$deal['min_loan_money_format'] = format_price($deal['min_loan_money']);
if($deal['uloadtype'] == 1){
if($deal['buy_count'] == 0)
$deal['buy_portion'] = 0;
else
$deal['buy_portion'] = intval($deal['load_money']/$deal['min_loan_money']);
$deal['need_portion'] = intval(($deal['borrow_amount'] - $deal['load_money']) / $deal['min_loan_money']);
}
if($deal['deal_status']>=4){
//总的必须还多少本息
$deal['remain_repay_money'] = $deal_repay_rs['remain_repay_money'];
//还有多少需要还
$deal['need_remain_repay_money'] = floatval($deal['remain_repay_money']) - floatval($deal['repay_money']);
//还款进度条
if($deal['remain_repay_money'] > 0)
{
$deal['repay_progress_point'] = $deal['repay_money']/$deal['remain_repay_money']*100;
if($dea
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
方维3.4专业P2P网络贷款借贷系统投资理财平台网站源码.zip (2000个子文件)
.tmp_user_step_two.html.80641~ 11KB
lang.php.bak 34KB
ea469af74347db098adc2840619b1b25.css 95KB
623550f5bd38e30e6e8e5fe151df6ffe.css 84KB
27dee97f0e93697a96020719eda86b05.css 75KB
fc39e5aa51a13bb1a064333c35361ab1.css 74KB
2b9c5e43a1d3a7f08bc3f2afa46833ec.css 73KB
common.css 64KB
style.css 46KB
animate.css 32KB
static.css 29KB
default.css 22KB
uc.css 22KB
datepicker.css 19KB
base.css 18KB
weebox.css 17KB
default.css 16KB
index.css 15KB
layer.css 14KB
m.css 14KB
index.css 11KB
debit_style.css 11KB
tinymce.css 10KB
oxygen.css 10KB
zc.css 10KB
style.css 9KB
btn.css 7KB
index.css 6KB
deal.css 6KB
calendar.css 6KB
everwin.css 5KB
kefu.css 5KB
debit_index.css 5KB
transfer.css 5KB
anquan.css 4KB
peizi_deal.css 4KB
weebox.css 4KB
mobile_index.css 3KB
peizi_deals.css 3KB
iconfont.css 3KB
qq.css 3KB
colorpicker.css 3KB
jquery.fullPage.css 3KB
jquery.slideBox.css 3KB
demo.css 3KB
indexshow.css 3KB
uc_deal_mobile.css 3KB
debit_security_center.css 3KB
everwin_confirm.css 3KB
debit_register.css 2KB
guide.css 2KB
jquery.lightbox-0.5.css 2KB
simple.css 2KB
index.css 2KB
debit_uc_data.css 2KB
scheme.css 2KB
debit_order_sure.css 2KB
peizi_list.css 2KB
peizi_detail.css 1KB
debit_login.css 1KB
score.css 1KB
debit_uc_my_order.css 1KB
print.css 1KB
debit_help_center.css 1KB
jqzoom.css 1KB
user_login_regiter.css 1KB
file_manager.css 1KB
top.css 1023B
left.css 979B
prettify.css 973B
debit_order_list.css 875B
jquery.autocomplete.css 845B
login.css 804B
editor.css 775B
debit_account_info.css 545B
everwin_inc_1.css 431B
everwin_inc_0.css 431B
scheme_inc_0.css 426B
scheme_inc_1.css 426B
footer.css 248B
main.css 201B
style.css 48B
zoom.cur 2KB
iconfont.eot 30KB
login_left.gif 19KB
ui-buttonbg.gif 19KB
btn_pre.gif 13KB
user_rl.gif 9KB
lightbox-ico-loading.gif 8KB
user_app_login.gif 5KB
status_1.gif 4KB
image_err.gif 4KB
u_z.gif 3KB
u_t.gif 3KB
u_j.gif 3KB
msg_btn.gif 3KB
keep_btn.gif 2KB
logo.gif 2KB
left_title1.gif 2KB
sub_nav_bg.gif 2KB
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
黄啊码
- 粉丝: 1w+
- 资源: 2313
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- ssm前后端分离鲜花销售系统+vue.zip
- ssm人力资源管理系统+vue.zip
- dropdown 是一款基于layui框架的下拉框控件,填补了layui原生没有下拉框这个空隙 借助下拉框的操作方式和UI交互,可以带来更加直观、便于操作、模块划分清晰等优势
- ssm企业人事管理系统的设计与实现+jsp.zip
- ssm农业视频实时发布管理系统设计+jsp.zip
- ssm农家乐信息平台的设计与实现+vue.zip
- 西门子PLC1500大型程序fanuc机器人焊装 包括1台 西门子1500PLC程序,2台触摸屏TP1500程序 9个智能远程终端ET200SP Profinet连接 15个Festo气动智能模块P
- ssm农产品仓库管理系统系统+jsp.zip
- ssm绿色农产品推广应用网站+vue.zip
- ssm民宿管理系统+jsp.zip
- ssm旅游网站的设计与实现+jsp.zip
- ssm旅游攻略网站设计+jsp.zip
- ssm旅游景点管理系统设计+jsp.zip
- ssm连锁经营商业管理系统+jsp.zip
- ssm临沂旅游咨询系统+vue.zip
- ssm旅行社管理系统的设计与实现+jsp.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功