public function notify() { //支付跳转返回页 if ($GLOBALS['pay_req']['class_name']) { $_REQUEST['class_name'] = $GLOBALS['pay_req']['class_name']; } $class_name = quotes(trim($_REQUEST['class_name'])); $payment_info = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "payment where class_name = '" . $class_name . "'"); if ($payment_info) { require_once APP_ROOT_PATH . "system/payment/" . $payment_info['class_name'] . "_payment.php"; $payment_class = $payment_info['class_name'] . "_payment"; $payment_object = new $payment_class(); $_REQUEST = quotes($_REQUEST); $payment_code = $payment_object->notify($_REQUEST); get_mortgate(); } }
public function index() { $id = intval($GLOBALS['request']['id']); $email = strim($GLOBALS['request']['email']); $pwd = strim($GLOBALS['request']['pwd']); if (!dealIdIsExist($id, 1)) { $result = responseErrorInfo("deal_id参数错误"); output($result); } $user = user_check($email, $pwd); $user_id = intval($user['id']); get_mortgate(); // 不知道为什么要冻结 $deal_info = $this->getDealInfo($id, $user_id); $leader_info = getLeaderInfo($id); $deal_new_info = $this->getNewDeal_info($deal_info); // $stock_info = $this->getStockAndUnStock ( $deal_info ); // $history_info = $this->getHistoryInfo ( $deal_info ); // $plan_info = $this->getPlanInfo ( $deal_info ); $result = responseSuccessInfo("项目详情"); $result["deal_info"] = $deal_new_info; $result['leader_info'] = $leader_info; // $result ['stock_info'] = $stock_info; // $result ['history_info'] = $history_info; // $result ['plan_info'] = $plan_info; if ($user_id > 0) { $is_focus = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "deal_focus_log where deal_id = " . $id . " and user_id = " . $user_id); $result['is_focus'] = $is_focus; } $result['business_url'] = get_domain() . url_mapi_html("deal#business", array("id" => $id, "user_id" => $user_id)); $result['teams_url'] = get_domain() . url_mapi_html("deal#teams", array("id" => $id, "user_id" => $user_id)); $result['history_url'] = get_domain() . url_mapi_html("deal#history", array("id" => $id, "user_id" => $user_id)); $result['plans_url'] = get_domain() . url_mapi_html("deal#plans", array("id" => $id, "user_id" => $user_id)); $url = replace_mapi(url_wap("deal#show", array("id" => $id))); $result['share_url'] = $url; if ($GLOBALS['m_config']['wx_appid'] != '' && $GLOBALS['m_config']['wx_secrit'] != '') { $weixin_1 = new weixin($GLOBALS['m_config']['wx_appid'], $GLOBALS['m_config']['wx_secrit'], $url); $wx_url = $weixin_1->scope_get_code(); $result['wx_share_url'] = $wx_url; } output($result); }
} //输出导航菜单 $nav_list = get_nav_list(); $nav_list = init_nav_list($nav_list); $GLOBALS['tmpl']->assign("nav_list", $nav_list); //输出SEO元素 $GLOBALS['tmpl']->assign("site_name", app_conf("SITE_NAME")); $GLOBALS['tmpl']->assign("seo_title", app_conf("SEO_TITLE")); $GLOBALS['tmpl']->assign("seo_keyword", app_conf("SEO_KEYWORD")); $GLOBALS['tmpl']->assign("seo_description", app_conf("SEO_DESCRIPTION")); $helps = load_auto_cache("helps"); $GLOBALS['tmpl']->assign("helps", $helps); //删除超过三天的订单 $GLOBALS['db']->query("delete from " . DB_PREFIX . "deal_order where order_status = 0 and credit_pay = 0 and " . NOW_TIME . " - create_time > " . 24 * 3600 * 3); $has_deal_notify = intval($GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "deal_notify")); define("HAS_DEAL_NOTIFY", $has_deal_notify); //存在待发的项目通知 if ($user_info) { $user_notify_count = intval($GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "user_notify where user_id = " . intval($user_info['id']) . " and is_read = 0")); $user_message_count = intval($GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "user_message where user_id = " . intval($user_info['id']) . " and is_read = 0")); $GLOBALS['tmpl']->assign("USER_NOTIFY_COUNT", $user_notify_count); $GLOBALS['tmpl']->assign("USER_MESSAGE_COUNT", $user_message_count); $GLOBALS['tmpl']->assign("HIDE_USER_NOTIFY", intval(es_cookie::get("hide_user_notify"))); } } //页脚的文章分类信息 star $help_cates = load_auto_cache("new_hepls"); $GLOBALS['tmpl']->assign("help_cates", $help_cates); //页脚的文章分类信息 end get_mortgate(); $GLOBALS['tmpl']->assign("now", NOW_TIME);
public function project_follow() { if (app_conf("INVEST_STATUS") == 1) { showErr("股权众筹已经关闭"); } get_mortgate(); //获取项目的ID $id = intval($_REQUEST['deal_id']); $deal_info = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "deal where id = " . $id . " and is_delete = 0 and is_effect = 1"); $deal_info['deal_type'] = $GLOBALS['db']->getOne("select name from " . DB_PREFIX . "deal_cate where id=" . $deal_info['cate_id']); $deal_info['login_time'] = $GLOBALS['db']->getOne("select login_time from " . DB_PREFIX . "user where id=" . $deal_info['user_id']); $deal_info = cache_deal_extra($deal_info); // $comment_count = $GLOBALS['db']->getOne("select count(*) from ".DB_PREFIX."deal_comment where deal_id = ".$id." and log_id = 0 and status=1"); // $GLOBALS['tmpl']->assign('comment_count',$comment_count); $this->init_deal_page(@$deal_info); set_deal_status($deal_info); //股权众筹 $GLOBALS['tmpl']->assign("id", $id); $user_name = $GLOBALS['user_info']['user_name']; $GLOBALS['tmpl']->assign("user_name", $user_name); $cate = $GLOBALS['db']->getOne("select name from " . DB_PREFIX . "deal_cate where id =" . $deal_info['cate_id']); $GLOBALS['tmpl']->assign("cate", $cate); //跟投、领投信息列表 get_investor_info($id, 1); $GLOBALS['tmpl']->display("project_follow.html"); }
public function index() { get_mortgate(); $GLOBALS['tmpl']->caching = true; $cache_id = md5(MODULE_NAME . ACTION_NAME); $image_list = load_dynamic_cache("INDEX_IMAGE_LIST"); if ($image_list === false) { $image_list = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "index_image order by sort asc"); set_dynamic_cache("INDEX_IMAGE_LIST", $image_list); } $GLOBALS['tmpl']->assign("image_list", $image_list); $cate_list = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "deal_cate where is_delete=0 order by sort asc"); $cate_result = array(); foreach ($cate_list as $k => $v) { $cate_result[$v['id']] = $v; } $GLOBALS['tmpl']->assign("cate_list", $cate_result); send_deal_success_1(); send_deal_fail_1(); //===============首页项目列表START=================== $page_size = 5; $limit = "0,5"; $GLOBALS['tmpl']->assign("current_page", 1); $deal_result = get_deal_list($limit, 'is_recommend=1'); $GLOBALS['tmpl']->assign("deal_list", $deal_result['list']); $deal_invest_result = get_deal_list($limit, ''); $GLOBALS['tmpl']->assign("deal_list_invest", $deal_invest_result['list']); $shu = $GLOBALS['db']->getAll("select count(*) from " . DB_PREFIX . "deal where is_recommend=1 and type=0"); $shu = $shu[0]['count(*)']; $GLOBALS['tmpl']->assign("shu", $shu); $all_shu = $GLOBALS['db']->getAll("select count(*) from " . DB_PREFIX . "deal where type=0"); $all_shu = $all_shu[0]['count(*)']; $GLOBALS['tmpl']->assign("all_shu", $all_shu); //===============首页项目列表END=================== //links $g_links = get_link_by_id(); /*虚拟的累计项目总个数,支持总人数,项目支持总金额*/ if (app_conf("INVEST_STATUS") == 0) { $condition = " and 1=1 "; } elseif (app_conf("INVEST_STATUS") == 1) { $condition = " and type=0 "; } elseif (app_conf("INVEST_STATUS") == 2) { $condition = " and type=1 "; } $virtual_effect = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "deal where is_effect = 1 and is_delete=0 {$condition}"); $virtual_person = $GLOBALS['db']->getOne("select sum((support_count+virtual_num)) from " . DB_PREFIX . "deal where is_effect = 1 and is_delete=0 {$condition}"); $virtual_money = $GLOBALS['db']->getOne("select sum(support_amount+virtual_price) from " . DB_PREFIX . "deal where is_effect = 1 and is_delete=0 {$condition}"); $zhuce_num = $GLOBALS['db']->getOne("select count(*) as num from " . DB_PREFIX . "user where is_effect = 1"); $GLOBALS['tmpl']->assign("zhuce_num", $zhuce_num); $virtual_effect = floor($virtual_effect * 2.3); $GLOBALS['tmpl']->assign("virtual_effect", $virtual_effect); //项目总个数 $virtual_person = floor($virtual_person * 2.7); $GLOBALS['tmpl']->assign("virtual_person", $virtual_person); //累计支持人 //$virtual_money = floor($virtual_money*2.1); $GLOBALS['tmpl']->assign("virtual_money", number_format($virtual_money, 2)); //筹资总金额 /*虚拟的累计项目总个数,支持总人数,项目支持总金额 结束*/ //首页TAB选项卡 if (app_conf("INVEST_STATUS") == 0) { $condition = " d.is_delete = 0 and d.is_effect = 1 "; } elseif (app_conf("INVEST_STATUS") == 1) { $condition = " d.is_delete = 0 and d.is_effect = 1 and d.type=0 "; } elseif (app_conf("INVEST_STATUS") == 2) { $condition = " d.is_delete = 0 and d.is_effect = 1 and d.type=1 "; } if ($GLOBALS['user_info']['user_level'] != 0) { $level = $GLOBALS['db']->getOne("SELECT level from " . DB_PREFIX . "user_level where id=" . $GLOBALS['user_info']['user_level']); $condition .= " AND (d.user_level ='' or d.user_level=0 or d.user_level <={$level}) "; } else { $condition .= " AND (d.user_level =0 or d.user_level =1 or d.user_level ='') AND d.is_recommend='1'"; } //最后发起的项目,如果被设置为推荐,被选项卡显示 $deal_cate_array = $GLOBALS['db']->getAll("select d.* from (select * from " . DB_PREFIX . "deal order by sort asc) as d left join " . DB_PREFIX . "deal_cate as dc on dc.id=d.cate_id where {$condition} group by d.cate_id order by dc.sort asc "); $deal_cate = array(); $now_time = NOW_TIME; foreach ($deal_cate_array as $k => $v) { if ($v['id'] > 0) { $v['cate_name'] = $cate_result[$v['cate_id']]['name']; $v['percent'] = round($v['support_amount'] / $v['limit_price'] * 100); $v['num_days'] = ceil(($v['end_time'] - $v['begin_time']) / (24 * 3600)); $v['remain_days'] = ceil(($v['end_time'] - $now_time) / (24 * 3600)); if ($v['begin_time'] > $now_time) { $v['left_days'] = intval(($now_time - $v['create_time']) / 24 / 3600); } $v['num_days'] = ceil(($v['end_time'] - $v['begin_time']) / (24 * 3600)); $deal_ids[] = $v['id']; $deal_cate[$v['id']] = $v; } } //将获取到的虚拟人数和虚拟价格拿到项目列表里面进行统计 foreach ($deal_cate as $k => $v) { if ($v['type'] == 1) { $deal_cate[$k]['virtual_person'] = $deal_cate[$k]['invote_num']; $deal_cate[$k]['support_count'] = $deal_cate[$k]['invote_num']; $deal_cate[$k]['support_amount'] = $deal_cate[$k]['invote_money']; $deal_cate[$k]['percent'] = round($deal_cate[$k]['support_amount'] / $v['limit_price'] * 100); } else { $deal_cate[$k]['virtual_person'] = $deal_cate[$k]['virtual_num']; $deal_cate[$k]['support_count'] = $deal_cate[$k]['virtual_num'] + $deal_cate[$k]['support_count']; $deal_cate[$k]['support_amount'] = $deal_cate[$k]['virtual_price'] + $deal_cate[$k]['support_amount']; $deal_cate[$k]['percent'] = round($deal_cate[$k]['support_amount'] / $v['limit_price'] * 100); } } $GLOBALS['tmpl']->assign("deal_cate", $deal_cate); $GLOBALS['tmpl']->assign("g_links", $g_links); //获取专题列表 $topic_num = $GLOBALS['db']->getOne("select count(*) as num from " . DB_PREFIX . "zhuanti where 1 "); $GLOBALS['tmpl']->assign("topic_num", $topic_num); $topic_list = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "zhuanti where state=1 order by sort desc limit 0,3"); $GLOBALS['tmpl']->assign("topic_list", $topic_list); $GLOBALS['tmpl']->display("index.html"); }