public function project_follow() { if (app_conf("INVEST_STATUS") == 1) { showErr("股权众筹已经关闭"); } //get_mortgate(); $access = get_level_access($GLOBALS['user_info'], $deal_info); $GLOBALS['tmpl']->assign("access", $access); //获取项目的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['user_icon'] = $GLOBALS['user_level'][$deal_info['user_level']]['icon']; $deal_info['is_investor'] = $GLOBALS['db']->getOne("select is_investor 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 project_follow() { //获取项目的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 = 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 plans() { $id = intval($_REQUEST['id']); $deal_info = $GLOBALS['db']->getRow("select d.*,dl.level as deal_level,dc.name as deal_type from " . DB_PREFIX . "deal as d left join " . DB_PREFIX . "deal_level as dl on dl.id=d.user_level left join " . DB_PREFIX . "deal_cate as dc on dc.id=d.cate_id where d.id = " . $id . " and d.is_delete = 0 and (d.is_effect = 1 or (d.is_effect = 0 and d.user_id = " . intval($GLOBALS['user_info']['id']) . "))"); $deal_info = cache_deal_extra($deal_info); if ($deal_info['type'] == 1) { $this->init_deal_page(@$deal_info); } else { init_deal_page_wap(@$deal_info); } if ($deal_info['type'] == 1) { set_deal_status($deal_info); $GLOBALS['tmpl']->assign("id", $id); $user_name = $GLOBALS['user_info']['user_name']; $GLOBALS['tmpl']->assign("user_name", $user_name); $deal_info['business_create_time'] = to_date($deal_info['business_create_time'], 'Y-m-d'); $cate = $GLOBALS['db']->getOne("select name from " . DB_PREFIX . "deal_cate where id =" . $deal_info['cate_id']); $GLOBALS['tmpl']->assign("cate", $cate); //未来三年内计划 $plan_list = unserialize($deal_info['plan']); $GLOBALS['tmpl']->assign("plan_list", $plan_list); $total_plan_income = 0; $total_plan_out = 0; $total_plan = 0; foreach ($plan_list as $key => $v) { $total_plan_income += intval($v["info"]["item_income"]); $total_plan_out += intval($v["info"]["item_out"]); $total_plan = $total_plan_income - $total_plan_out; } $GLOBALS['tmpl']->assign("total_plan_income", $total_plan_income); $GLOBALS['tmpl']->assign("total_plan_out", $total_plan_out); $GLOBALS['tmpl']->assign("total_plan", $total_plan); $GLOBALS['tmpl']->assign('now', NOW_TIME); $GLOBALS['tmpl']->assign("deal_item", $deal_info); $GLOBALS['tmpl']->display("investor_plans_mapi.html"); } }