public function index() { $root = array(); $root['response_code'] = 1; $id = intval($_REQUEST['id']); $email = strim($GLOBALS['request']['email']); // 用户名或邮箱 $pwd = strim($GLOBALS['request']['pwd']); // 密码 // 检查用户,用户密码 $user = user_check($email, $pwd); $user_id = intval($user['id']); $deal_info = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "deal where id = " . $id . " and is_delete = 0 and (is_effect = 1 or (is_effect = 0 and user_id = " . $user_id . "))"); $deal_info = cache_deal_extra($deal_info); $page_size = $GLOBALS['m_config']['page_size']; $page = intval($_REQUEST['p']); if ($page == 0) { $page = 1; } $limit = ($page - 1) * $page_size . "," . $page_size; $support_list = $GLOBALS['db']->getAll("select user_id,price from " . DB_PREFIX . "deal_support_log where deal_id = " . $id . " order by create_time desc limit " . $limit); $support_count = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "deal_support_log where deal_id = " . $id); $user_list = array(); $user_ids = array(); foreach ($support_list as $k => $v) { if ($v['user_id']) { $user_ids[] = $v['user_id']; } } $user_ids = array_filter($user_ids); if ($user_ids) { $user_id_str = implode(',', array_filter($user_ids)); $user_list_array = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "user where id in (" . $user_id_str . ") "); foreach ($user_list_array as $k => $v) { foreach ($support_list as $k_support => $v_support) { if ($v['id'] == $v_support['user_id']) { $support_list[$k_support]['user_info'] = $v; $support_list[$k_support]['user_info']["image"] = get_user_avatar_root($v["id"], "middle"); $support_list[$k_support]['user_info']["url"] = url_root("home", array("id" => $v["user_id"])); } } } } $root['support_list'] = $support_list; // ----------------------------------- $virtual_person = $GLOBALS['db']->getOne("select sum(virtual_person) from " . DB_PREFIX . "deal_item where deal_id=" . $id); // 获得该项目下的子项目的所有信息 // $deal_item_list=$GLOBALS['db']->getAll("select * from // ".DB_PREFIX."deal_item where deal_id=".$id); $deal_item_list = $deal_info['deal_item_list']; foreach ($deal_item_list as $k => $v) { // 统计每个子项目真实+虚拟(人) $deal_item_list[$k]['virtual_person'] = $v['virtual_person'] + $v['support_count']; // 统计所有真实+虚拟(钱) $deal_item_list[$k]['virtual_price'] = $v['price'] * $deal_item_list[$k]['virtual_person']; // 支付该项花费的金额 $deal_item_list[$k]['total_price'] = $v['price'] + $v['delivery_fee']; $deal_item_list[$k]['delivery_fee_format'] = number_price_format($v['delivery_fee']); $deal_item_list[$k]['content'] = $v['description']; foreach ($deal_item_list[$k]['images'] as $kk => $vv) { $deal_item_list[$k]['images'][$kk]['image'] = get_abs_img_root(get_spec_image($vv['image'], 640, 240, 1)); } } $root['deal_item_list'] = $deal_item_list; $root['person'] = $virtual_person + $deal_info['support_count']; // ----------------------------------- if ($deal_info['user_id'] > 0) { $deal_user_info = $GLOBALS['db']->getRow("select id,user_name,province,city,intro,login_time from " . DB_PREFIX . "user where id = " . $deal_info['user_id'] . " and is_effect = 1"); if ($deal_user_info == false) { $deal_user_info = NULL; } $root['deal_user_info'] = $deal_user_info; } // $root['support_list'] = $support_list; $root['page'] = array("page" => $page, "page_total" => ceil($support_count / $page_size), "page_size" => intval($page_size), 'total' => intval($support_count)); output($root); }
public function index() { $root = array(); $root['response_code'] = 1; $id = intval($_REQUEST['id']); $email = strim($GLOBALS['request']['email']); // 用户名或邮箱 $pwd = strim($GLOBALS['request']['pwd']); // 密码 // 检查用户,用户密码 $user = user_check($email, $pwd); $user_id = intval($user['id']); $deal_info = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "deal where id = " . $id . " and is_delete = 0 and (is_effect = 1 or (is_effect = 0 and user_id = " . intval($GLOBALS['user_info']['id']) . "))"); if (!$deal_info) { app_redirect(url("index")); } $deal_info = cache_deal_extra($deal_info); init_deal_page($deal_info); $page_size = $GLOBALS['m_config']['page_size']; $page = intval($_REQUEST['p']); if ($page == 0) { $page = 1; } $limit = ($page - 1) * $page_size . "," . $page_size; $log_list = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "deal_log where deal_id = " . $deal_info['id'] . " order by create_time desc limit " . $limit); $log_count = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "deal_log where deal_id = " . $deal_info['id']); $url = url_wap("deal#show", array("id" => $id)); $root['url'] = $url; $last_time_key = ""; foreach ($log_list as $k => $v) { $log_list[$k]['image'] = get_user_avatar_root($v["user_id"], "middle"); //用户头像 //$log_list[$k]['image'] = get_abs_img_root(get_spec_image($v['image'],640,240,1)); $log_list[$k]['pass_time'] = pass_date($v['create_time']); $online_time = online_date($v['create_time'], $deal_info['begin_time']); $log_list[$k]['online_time'] = $online_time['info']; $log_list[$k]['comment_data_cache'] = null; $log_list[$k]['deal_info_cache'] = null; if ($online_time['key'] != $last_time_key) { $last_time_key = $log_list[$k]['online_time_key'] = $online_time['key']; } $log_list[$k] = cache_log_comment($log_list[$k]); } $root['log_list'] = $log_list; // require APP_ROOT_PATH.'app/Lib/page.php'; // $page = new Page($log_count,$page_size); //初始化分页对象 // $p = $page->show(); // $root['pages'] = $p; $root['page'] = array("page" => $page, "page_total" => ceil($log_count / $page_size), "page_size" => intval($page_size), 'total' => intval($log_count)); output($root); }
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; $province_str = $GLOBALS['db']->getOne("select province from " . DB_PREFIX . "user where id = " . $user_id); $city_str = $GLOBALS['db']->getOne("select city from " . DB_PREFIX . "user where id = " . $user_id); if ($province_str . $city_str == '') { $user_location = '未知'; } else { $user_location = $province_str . " " . $city_str; } $user['money_format'] = format_price($user['money']); //可用资金 $user['create_time_format'] = to_date($user['create_time'], 'Y-m-d'); //注册时间 $root['response_code'] = 1; $root['user_name'] = $user['user_name']; $root['money_format'] = $user['money_format']; $root['money'] = $user['money']; $root['create_time_format'] = $user['create_time_format']; $root['sex'] = $user['sex']; $root['province'] = $user['province']; $root['city'] = $user['city']; $root['intro'] = $user['intro']; $root['email'] = $user['email']; $root['image'] = get_user_avatar_root($user['id'], "middle"); $weibo_list = $GLOBALS['db']->getOne("select weibo_url from " . DB_PREFIX . "user_weibo where user_id = " . intval($GLOBALS['user_info']['id'])); $root['weibo_list'] = $weibo_list; } else { $root['response_code'] = 0; $root['show_err'] = "未登录"; $root['user_login_status'] = 0; } output($root); }
public function index() { $root = array(); $root['response_code'] = 1; $id = intval($_REQUEST['id']); $email = strim($GLOBALS['request']['email']); // 用户名或邮箱 $pwd = strim($GLOBALS['request']['pwd']); // 密码 // 检查用户,用户密码 $user = user_check($email, $pwd); $user_id = intval($user['id']); $deal_info = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "deal where id = " . $id . " and is_delete = 0 and (is_effect = 1 or (is_effect = 0 and user_id = " . $user_id . "))"); $deal_info = cache_deal_extra($deal_info); init_deal_page($deal_info); $page_size = $GLOBALS['m_config']['page_size']; $page = intval($_REQUEST['p']); if ($page == 0) { $page = 1; } $limit = ($page - 1) * $page_size . "," . $page_size; $comment_list = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "deal_comment where deal_id = " . $id . " and log_id = 0 order by create_time desc limit " . $limit); // $comment_list = $GLOBALS['db']->getAll("select * from // ".DB_PREFIX."deal_comment where deal_id = ".$id." and log_id = 0 // order by create_time desc "); $comment_count = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "deal_comment where deal_id = " . $id . " and log_id = 0"); foreach ($comment_list as $k => $v) { $comment_list[$k]['create_time'] = to_date($v['create_time'], 'Y-m-d'); $comment_list[$k]["image"] = get_user_avatar_root($v["user_id"], "middle"); $comment_list[$k]["url"] = url_root("home", array("id" => $v["user_id"])); } $root['comment_list'] = $comment_list; $root['comment_count'] = $comment_count; // require APP_ROOT_PATH.'app/Lib/page.php'; // $page = new Page($comment_count,$page_size); //初始化分页对象 // $p = $page->show(); // $root['pages'] = $p; $root['page'] = array("page" => $page, "page_total" => ceil($comment_count / $page_size), "page_size" => intval($page_size), 'total' => intval($comment_count)); output($root); }
/** 领投信息查询 */ function getLeaderInfo($deal_id) { $leader_info = $GLOBALS['db']->getRow("select i.*,u.user_name,u.identify_name,u.is_investor,u.identify_business_name from " . DB_PREFIX . "investment_list i LEFT JOIN " . DB_PREFIX . "user as u on u.id=i.user_id where i.deal_id=" . $deal_id . " and i.type=1 and status=1 GROUP BY i.user_id,i.user_id ORDER BY i.user_id DESC"); if ($leader_info > 0) { $leader_info['image'] = get_user_avatar_root($leader_info["user_id"], "middle"); $leader_info['create_time'] = to_date($leader_info['create_time']); } return $leader_info; }
public function index() { $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']) . "))"); $access = get_level_access($GLOBALS['user_info'], $deal_info); $GLOBALS['tmpl']->assign("access", $access); if (!$deal_info) { app_redirect(url_wap("index")); } if ($deal_info['is_effect'] == 1) { log_deal_visit($deal_info['id']); } $wx = array(); $wx['img_url'] = $deal_info['image']; $wx['title'] = $deal_info['name']; $wx['desc'] = $deal_info['brief']; $GLOBALS['tmpl']->assign('wx', $wx); $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); } $limit = "0,3"; $log_list = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "deal_log where deal_id = " . $deal_info['id'] . " order by create_time desc limit " . $limit); foreach ($log_list as $k => $v) { if ($v['user_id']) { $user_ids[] = $v['user_id']; } } $user_ids = array_filter($user_ids); if ($user_ids) { $user_id_str = implode(',', array_filter($user_ids)); $user_list_array = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "user where id in (" . $user_id_str . ") "); foreach ($user_list_array as $k => $v) { foreach ($log_list as $k_log => $v_log) { if ($v['id'] == $v_log['user_id']) { $v['avatar'] = get_user_avatar_root($v["id"], "middle"); $log_list[$k_log]['user_info'] = $v; } } } } $log_num = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "deal_log where deal_id = " . $deal_info['id']); $GLOBALS['tmpl']->assign("log_list", $log_list); $GLOBALS['tmpl']->assign("log_num", intval($log_num)); $comment_list = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "deal_comment where deal_id = " . $id . " and log_id = 0 and status=1 order by create_time desc limit " . $limit); $comment_count = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "deal_comment where deal_id = " . $id . " and log_id = 0 and status=1 "); $user_ids = array(); foreach ($comment_list as $k => $v) { if ($v['user_id']) { $user_ids[] = $v['user_id']; } } $user_ids = array_filter($user_ids); if ($user_ids) { $user_id_str = implode(',', array_filter($user_ids)); $user_list_array = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "user where id in (" . $user_id_str . ") "); foreach ($user_list_array as $k => $v) { foreach ($comment_list as $k_comment => $v_comment) { if ($v['id'] == $v_comment['user_id']) { $v['avatar'] = get_user_avatar_root($v["id"], "middle"); $comment_list[$k_comment]['user_info'] = $v; } } } } $GLOBALS['tmpl']->assign("info_url", url_wap("deal#info", array("id" => $id))); $GLOBALS['tmpl']->assign("comment_list", $comment_list); $GLOBALS['tmpl']->assign("comment_count", intval($comment_count)); $GLOBALS['tmpl']->assign("deal_index_url", url_wap("deal#index", array("id" => $id))); $GLOBALS['tmpl']->assign("usermessage_url", url_wap("ajax#usermessage", array("id" => $deal_info['user_id']))); $GLOBALS['tmpl']->assign("home_url", url_wap("deal#home", array("id" => $deal_info['user_id']))); 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'); $cates = $GLOBALS['db']->getOne("select name from " . DB_PREFIX . "deal_cate where id =" . $deal_info['cate_id']); //编辑及管理团队 $stock_list = unserialize($deal_info['stock']); $GLOBALS['tmpl']->assign("stock_list", $stock_list); $unstock_list = unserialize($deal_info['unstock']); $GLOBALS['tmpl']->assign("unstock_list", $unstock_list); //项目历史执行资料 $history_list = unserialize($deal_info['history']); $GLOBALS['tmpl']->assign("history_list", $history_list); $total_history_income = 0; $total_history_out = 0; $total_history = 0; foreach ($history_list as $key => $v) { $total_history_income += floatval($v["info"]["item_income"]); $total_history_out += floatval($v["info"]["item_out"]); $total_history = $total_history_income - $total_history_out; } $GLOBALS['tmpl']->assign("total_history_income", $total_history_income); $GLOBALS['tmpl']->assign("total_history_out", $total_history_out); $GLOBALS['tmpl']->assign("total_history", $total_history); //未来三年内计划 $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 += floatval($v["info"]["item_income"]); $total_plan_out += floatval($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); //项目附件 $attach_list = unserialize($deal_info['attach']); $GLOBALS['tmpl']->assign("attach_list", $attach_list); //资质证明 $audit_data_list = unserialize($deal_info['audit_data']); $GLOBALS['tmpl']->assign("audit_data_list", $audit_data_list); //跟投、领投信息列表 get_investor_info($id, 1); $GLOBALS['tmpl']->assign('now', NOW_TIME); $GLOBALS['tmpl']->assign("cates", $cates); $GLOBALS['tmpl']->assign("deal_item", $deal_info); $GLOBALS['tmpl']->display("deal_investor_show.html"); } else { // //print_r($deal_info);exit; $GLOBALS['tmpl']->display("deal_details.html"); } }
public function index() { $id = intval($_REQUEST['id']); $t = $_REQUEST['t']; $is_ap = $_REQUEST['isap']; $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']) . "))"); $is_ap = $is_ap || ($deal_info['is_ap'] == 1 || $deal_info['is_ap'] == 2) ? 1 : 0; if (!$deal_info) { app_redirect(url_wap("index")); } if ($deal_info['is_effect'] == 1) { log_deal_visit($deal_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); } // print_r($deal_info); $limit = "0,3"; $log_list = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "deal_log where deal_id = " . $deal_info['id'] . " order by create_time desc limit " . $limit); foreach ($log_list as $k => $v) { if ($v['user_id']) { $user_ids[] = $v['user_id']; } } $user_ids = array_filter($user_ids); if ($user_ids) { $user_id_str = implode(',', array_filter($user_ids)); $user_list_array = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "user where id in (" . $user_id_str . ") "); foreach ($user_list_array as $k => $v) { foreach ($log_list as $k_log => $v_log) { if ($v['id'] == $v_log['user_id']) { $v['avatar'] = get_user_avatar_root($v["id"], "middle"); $log_list[$k_log]['user_info'] = $v; } } } } $log_num = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "deal_log where deal_id = " . $deal_info['id']); $GLOBALS['tmpl']->assign("log_list", $log_list); $GLOBALS['tmpl']->assign("log_num", intval($log_num)); $comment_list = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "deal_comment where deal_id = " . $id . " and log_id = 0 order by create_time desc limit " . $limit); $comment_count = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "deal_comment where deal_id = " . $id . " and log_id = 0"); $user_ids = array(); foreach ($comment_list as $k => $v) { if ($v['user_id']) { $user_ids[] = $v['user_id']; } } $user_ids = array_filter($user_ids); if ($user_ids) { $user_id_str = implode(',', array_filter($user_ids)); $user_list_array = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "user where id in (" . $user_id_str . ") "); foreach ($user_list_array as $k => $v) { foreach ($comment_list as $k_comment => $v_comment) { if ($v['id'] == $v_comment['user_id']) { $v['avatar'] = get_user_avatar_root($v["id"], "middle"); $comment_list[$k_comment]['user_info'] = $v; } } } } // print_r($deal_info); $dealImageArray = array(); for ($i = 0; $i <= 8; $i++) { if (!empty($deal_info['imghead_' . $i])) { $tmpImgAry = array(); $tmpImgAry['imghead'] = get_spec_image($deal_info['imghead_' . $i], 800, 600, 1); $tmpImgAry['imghead_thumb'] = $deal_info['imghead_' . $i . '_thumb']; $dealImageArray[] = $tmpImgAry; } // print_r($deal_info['imghead_'.$i]); } $dealImageNum = count($dealImageArray); $dealImageLiNum = ceil($dealImageNum / 3); $dealImageLiArray = array(); for ($i = 0; $i < $dealImageLiNum; $i++) { $dealImageLiArray[] = $i; } // print_r($dealImageArray); //获取发布者头像 $GLOBALS['tmpl']->assign("deal_user_image", get_user_avatar($deal_info['user_id'], "middle")); $GLOBALS['tmpl']->assign("deal_image_list", $dealImageArray); $GLOBALS['tmpl']->assign("deal_image_num", $dealImageNum); $GLOBALS['tmpl']->assign("deal_image_li_array", $dealImageLiArray); $GLOBALS['tmpl']->assign("deal_image_li_num", $dealImageLiNum); $GLOBALS['tmpl']->assign("info_url", url_wap("deal#info", array("id" => $id))); $GLOBALS['tmpl']->assign("comment_list", $comment_list); $GLOBALS['tmpl']->assign("comment_count", intval($comment_count)); $GLOBALS['tmpl']->assign("deal_index_url", url_wap("deal#index", array("id" => $id))); $GLOBALS['tmpl']->assign("usermessage_url", url_wap("ajax#usermessage", array("id" => $deal_info['user_id']))); $GLOBALS['tmpl']->assign("home_url", url_wap("deal#home", array("id" => $deal_info['user_id']))); $GLOBALS['tmpl']->assign("wx_desc", $deal_info['brief']); $GLOBALS['tmpl']->assign("wx_image", $deal_info['image']); 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'); $cates = $GLOBALS['db']->getOne("select name from " . DB_PREFIX . "deal_cate where id =" . $deal_info['cate_id']); //编辑及管理团队 $stock_list = unserialize($deal_info['stock']); $GLOBALS['tmpl']->assign("stock_list", $stock_list); $unstock_list = unserialize($deal_info['unstock']); $GLOBALS['tmpl']->assign("unstock_list", $unstock_list); //项目历史执行资料 $history_list = unserialize($deal_info['history']); $GLOBALS['tmpl']->assign("history_list", $history_list); $total_history_income = 0; $total_history_out = 0; $total_history = 0; foreach ($history_list as $key => $v) { $total_history_income += intval($v["info"]["item_income"]); $total_history_out += intval($v["info"]["item_out"]); $total_history = $total_history_income - $total_history_out; } $GLOBALS['tmpl']->assign("total_history_income", $total_history_income); $GLOBALS['tmpl']->assign("total_history_out", $total_history_out); $GLOBALS['tmpl']->assign("total_history", $total_history); //未来三年内计划 $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); //项目附件 $attach_list = unserialize($deal_info['attach']); $GLOBALS['tmpl']->assign("attach_list", $attach_list); //资质证明 $audit_data_list = unserialize($deal_info['audit_data']); $GLOBALS['tmpl']->assign("audit_data_list", $audit_data_list); //跟投、领投信息列表 get_investor_info($id, 1); $GLOBALS['tmpl']->assign('now', NOW_TIME); $GLOBALS['tmpl']->assign("cates", $cates); $GLOBALS['tmpl']->assign("deal_item", $deal_info); $GLOBALS['tmpl']->assign("wx_desc", $deal_info['brief']); $GLOBALS['tmpl']->assign("wx_image", $deal_info['image']); $GLOBALS['tmpl']->display("deal_investor_show.html"); } else { $ratio = intval($deal_info['ap_ratio']); //取出支持项最贵的和最便宜的? for ($i = 0; $i < count($deal_info['deal_item_list']); $i++) { if ($i == 0) { $deal_item_bottom_price = $deal_info['deal_item_list'][$i]['price']; } if ($i == count($deal_info['deal_item_list']) - 1) { $deal_item_top_price = $deal_info['deal_item_list'][$i]['price']; } // $deal_info['deal_item_list'][$i]['ap_price_format'] = $deal_info['deal_item_list'][$i]['price_format']*$ratio; } // print_r($deal_info); if ($is_ap == 1) { $deal_item_bottom_price = $deal_item_bottom_price * $ratio; //用于临时展示,字段齐全后改为从字段取 $deal_item_top_price = $deal_item_top_price * $ratio; $support_amount = $deal_info['support_amount'] * $ratio; //获取用户积分数 $aq = $GLOBALS['db']->getOne("select ap from " . DB_PREFIX . "ap_partner_user where user_id=" . intval($GLOBALS['user_info']['id'])); $GLOBALS['tmpl']->assign("is_ap", $is_ap); $GLOBALS['tmpl']->assign("user_ap", $aq); } $GLOBALS['tmpl']->assign("bottom_price", number_price_format($deal_item_bottom_price)); $GLOBALS['tmpl']->assign("top_price", number_price_format($deal_item_top_price)); $GLOBALS['tmpl']->assign("support_amount", number_price_format($support_amount)); $time = time(); $v = $deal_info; //print_r($deal_info); if ($v['begin_time'] > $time) { $tmp_start_day = ceil(($v['start_time'] - $time) / 86400); $v['show'] = "还有" . $tmp_start_day . "天开始"; } elseif ($time > $v['end_time']) { $v['show'] = "已过期"; } else { $tmp_end_day = ceil(($v['end_time'] - $time) / 86400); $v['show'] = "剩余" . $tmp_end_day . "天"; } if ($t == "item") { //新支付的session // session_start(); // $_SESSION["confirm"] = $deal_info['id'].time(); // es_session::start(); es_session::set('confirm', time()); $region_pid = 0; $region_lv2 = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "region_conf where region_level = 2 order by py asc"); //二级地址 $GLOBALS['tmpl']->assign("region_lv2", $region_lv2); $region_lv3 = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "region_conf where pid = " . $region_pid . " order by py asc"); //三级地址 $GLOBALS['tmpl']->assign("region_lv3", $region_lv3); $GLOBALS['tmpl']->display("deal_details_items.html"); } else { $GLOBALS['tmpl']->assign("showday", $v['show']); if ($is_ap == 1) { $GLOBALS['tmpl']->display("ap_deal_details.html"); exit; } $GLOBALS['tmpl']->display("deal_details.html"); } } }