Beispiel #1
0
 public function index()
 {
     global_run();
     init_app_page();
     $GLOBALS['tmpl']->assign("no_nav", true);
     //无分类下拉
     if (check_save_login() != LOGIN_STATUS_LOGINED) {
         app_redirect(url("index", "user#login"));
     }
     $did = intval($_REQUEST['did']);
     require_once APP_ROOT_PATH . "app/Lib/page.php";
     $page_size = app_conf("PAGE_SIZE");
     $page = intval($_REQUEST['p']);
     if ($page == 0) {
         $page = 1;
     }
     $limit = ($page - 1) * $page_size . "," . $page_size;
     $user_id = $GLOBALS['user_info']['id'];
     $sql = "select * from " . DB_PREFIX . "youhui_log  where  " . " user_id = " . $user_id . " order by  create_time desc limit " . $limit;
     $sql_count = "select count(*) from " . DB_PREFIX . "youhui_log  where  " . " user_id = " . $user_id;
     $list = $GLOBALS['db']->getAll($sql);
     foreach ($list as $k => $v) {
         $list[$k]['youhui'] = load_auto_cache("youhui", array("id" => $v['youhui_id']));
     }
     $count = $GLOBALS['db']->getOne($sql_count);
     $page = new Page($count, $page_size);
     //初始化分页对象
     $p = $page->show();
     $GLOBALS['tmpl']->assign('pages', $p);
     $GLOBALS['tmpl']->assign("list", $list);
     $GLOBALS['tmpl']->assign("NOW_TIME", NOW_TIME);
     $GLOBALS['tmpl']->assign("page_title", "我的优惠券");
     assign_uc_nav_list();
     $GLOBALS['tmpl']->display("uc/uc_youhui_index.html");
 }
Beispiel #2
0
 public function exchange()
 {
     global_run();
     init_app_page();
     $GLOBALS['tmpl']->assign("no_nav", true);
     //无分类下拉
     if (check_save_login() != LOGIN_STATUS_LOGINED) {
         app_redirect(url("index", "user#login"));
     }
     $page = intval($_REQUEST['p']);
     if ($page == 0) {
         $page = 1;
     }
     $limit = ($page - 1) * app_conf("PAGE_SIZE") . "," . app_conf("PAGE_SIZE");
     $result = get_exchange_voucher_list($limit);
     $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_VOUCHER']);
     assign_uc_nav_list();
     //左侧导航菜单
     $GLOBALS['tmpl']->display("uc/uc_voucher_exchange.html");
 }
Beispiel #3
0
 public function index()
 {
     global_run();
     init_app_page();
     $GLOBALS['tmpl']->assign("no_nav", true);
     //无分类下拉
     if (check_save_login() != LOGIN_STATUS_LOGINED) {
         app_redirect(url("index", "user#login"));
     }
     $GLOBALS['tmpl']->assign("page_title", "我的点评");
     assign_uc_nav_list();
     //begin review
     require_once APP_ROOT_PATH . "system/model/review.php";
     require_once APP_ROOT_PATH . "app/Lib/page.php";
     //分页
     $page_size = 10;
     $page = intval($_REQUEST['p']);
     if ($page == 0) {
         $page = 1;
     }
     $limit = ($page - 1) * $page_size . "," . $page_size;
     $dp_res = get_dp_list($limit, "", " user_id = " . $GLOBALS['user_info']['id']);
     $dp_list = $dp_res['list'];
     $total = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "supplier_location_dp  where " . $dp_res['condition']);
     $page = new Page($total, $page_size);
     //初始化分页对象
     $p = $page->show();
     $GLOBALS['tmpl']->assign('pages', $p);
     foreach ($dp_list as $k => $v) {
         if ($v['deal_id'] > 0) {
             $data_info = load_auto_cache("deal", array("id" => $v['deal_id']));
         } elseif ($v['youhui_id'] > 0) {
             $data_info = load_auto_cache("youhui", array("id" => $v['youhui_id']));
         } elseif ($v['event_id'] > 0) {
             $data_info = load_auto_cache("event", array("id" => $v['event_id']));
         }
         if (empty($data_info)) {
             $data_info = load_auto_cache("store", array("id" => $v['supplier_location_id']));
         }
         $dp_list[$k]['data_info'] = $data_info;
     }
     $GLOBALS['tmpl']->assign('dp_list', $dp_list);
     require_once APP_ROOT_PATH . "system/model/topic.php";
     global $no_lazy;
     $no_lazy = true;
     $review_html = decode_topic_without_img($GLOBALS['tmpl']->fetch("inc/uc_review_list.html"));
     $GLOBALS['tmpl']->assign("review_html", $review_html);
     //end review
     $no_lazy = false;
     $GLOBALS['tmpl']->display("uc/uc_review_index.html");
 }
Beispiel #4
0
 public function index()
 {
     global_run();
     init_app_page();
     $GLOBALS['tmpl']->assign("no_nav", true);
     //无分类下拉
     if (check_save_login() != LOGIN_STATUS_LOGINED) {
         app_redirect(url("index", "user#login"));
     }
     $did = intval($_REQUEST['did']);
     require_once APP_ROOT_PATH . "app/Lib/page.php";
     $page_size = 10;
     $page = intval($_REQUEST['p']);
     if ($page == 0) {
         $page = 1;
     }
     $limit = ($page - 1) * $page_size . "," . $page_size;
     $user_id = $GLOBALS['user_info']['id'];
     require_once APP_ROOT_PATH . "system/model/deal_order.php";
     $order_item_table = get_user_order_item_table_name($user_id);
     $order_table = get_user_order_table_name($user_id);
     if ($did > 0) {
         $order_deal_item = $GLOBALS['db']->getRow("select doi.* from " . $order_item_table . " as doi left join " . $order_table . " as do on doi.order_id = do.id where doi.id = " . $did . " and doi.is_coupon = 1 and do.user_id = " . $user_id);
         $deal = load_auto_cache("deal", array("id" => $order_deal_item['deal_id']));
         $order_deal_item['url'] = $deal['url'];
     }
     if ($order_deal_item) {
         $sql = "select doi.sub_name,doi.name,doi.number,c.* from " . DB_PREFIX . "deal_coupon as c left join " . $order_item_table . " as doi on doi.id = c.order_deal_id where c.is_valid > 0 and " . " c.user_id = " . $user_id . " and doi.id = " . $order_deal_item['id'] . " order by c.id desc limit " . $limit;
         $sql_count = "select count(*) from " . DB_PREFIX . "deal_coupon as c where c.is_valid > 0 and " . " c.user_id = " . $user_id . " and c.order_deal_id = " . $order_deal_item['id'];
         $GLOBALS['tmpl']->assign("deal", $order_deal_item);
     } else {
         $sql = "select doi.sub_name,doi.name,doi.number,c.* from " . DB_PREFIX . "deal_coupon as c left join " . DB_PREFIX . "deal_order_item as doi on doi.id = c.order_deal_id where c.is_valid > 0 and " . " c.user_id = " . $user_id . " order by c.id desc limit " . $limit;
         $sql_count = "select count(*) from " . DB_PREFIX . "deal_coupon as c where c.is_valid > 0 and " . " c.user_id = " . $user_id;
     }
     $list = $GLOBALS['db']->getAll($sql);
     foreach ($list as $k => $v) {
         $list[$k]['deal'] = load_auto_cache("deal", array("id" => $v['deal_id']));
     }
     $count = $GLOBALS['db']->getOne($sql_count);
     $page = new Page($count, $page_size);
     //初始化分页对象
     $p = $page->show();
     $GLOBALS['tmpl']->assign('pages', $p);
     $GLOBALS['tmpl']->assign("list", $list);
     $GLOBALS['tmpl']->assign("NOW_TIME", NOW_TIME);
     $GLOBALS['tmpl']->assign("page_title", "我的团购券");
     assign_uc_nav_list();
     $GLOBALS['tmpl']->display("uc/uc_coupon_index.html");
 }
 public function add()
 {
     global_run();
     init_app_page();
     $GLOBALS['tmpl']->assign("no_nav", true);
     //无分类下拉
     if (check_save_login() != LOGIN_STATUS_LOGINED) {
         app_redirect(url("index", "user#login"));
     }
     if (intval($_REQUEST['id']) > 0) {
         $GLOBALS['tmpl']->assign("consignee_id", intval($_REQUEST['id']));
     }
     $GLOBALS['tmpl']->assign("page_title", "配送地址");
     assign_uc_nav_list();
     //左侧导航菜单
     $GLOBALS['tmpl']->display("uc/uc_consignee_add.html");
 }
Beispiel #6
0
 public function index()
 {
     global_run();
     init_app_page();
     $GLOBALS['tmpl']->assign("no_nav", true);
     //无分类下拉
     if (check_save_login() != LOGIN_STATUS_LOGINED) {
         app_redirect(url("index", "user#login"));
     }
     $GLOBALS['tmpl']->assign("page_title", "我的消息");
     $user_info = $GLOBALS['user_info'];
     require_once APP_ROOT_PATH . "app/Lib/page.php";
     $page_size = app_conf("PAGE_SIZE");
     $page = intval($_REQUEST['p']);
     if ($page == 0) {
         $page = 1;
     }
     $limit = ($page - 1) * $page_size . "," . $page_size;
     $sql = "select * from " . DB_PREFIX . "msg_box where user_id = " . $GLOBALS['user_info']['id'] . " and is_delete = 0 order by create_time desc limit " . $limit;
     $sql_count = "select count(*) from " . DB_PREFIX . "msg_box where user_id = " . $GLOBALS['user_info']['id'] . " and is_delete = 0 ";
     $list = $GLOBALS['db']->getAll($sql);
     $ids[] = 0;
     foreach ($list as $k => $v) {
         $list[$k] = load_msg($v['type'], $v);
         $list[$k]['create_time'] = to_date($v['create_time']);
         $ids[] = $v['id'];
     }
     $count = $GLOBALS['db']->getOne($sql_count);
     $page = new Page($count, $page_size);
     //初始化分页对象
     $p = $page->show();
     $GLOBALS['tmpl']->assign('pages', $p);
     $GLOBALS['tmpl']->assign("list", $list);
     $ids_str = implode(",", $ids);
     $GLOBALS['db']->query("update " . DB_PREFIX . "msg_box set is_read = 1 where user_id = " . $GLOBALS['user_info']['id'] . " and id in (" . $ids_str . ")");
     require_once APP_ROOT_PATH . "system/model/user.php";
     load_user($GLOBALS['user_info']['id'], true);
     assign_uc_nav_list();
     $GLOBALS['tmpl']->assign("user_info", $user_info);
     $GLOBALS['tmpl']->display("uc/uc_msg.html");
 }
Beispiel #7
0
 public function index()
 {
     require APP_ROOT_PATH . "system/model/uc_center_service.php";
     global_run();
     init_app_page();
     $GLOBALS['tmpl']->assign("no_nav", true);
     //无分类下拉
     if (check_save_login() != LOGIN_STATUS_LOGINED) {
         app_redirect(url("index", "user#login"));
     }
     $user_id = intval($GLOBALS['user_info']['id']);
     $list = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "medal where is_effect = 1 ");
     foreach ($list as $k => $v) {
         $list[$k]['url'] = url("index", "uc_medal#load_medal", array("id" => $v['id']));
     }
     $GLOBALS['tmpl']->assign('list', $list);
     $my_list = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "user_medal where user_id = " . $user_id . " and is_delete = 0 order by create_time desc");
     $GLOBALS['tmpl']->assign('my_list', $my_list);
     $GLOBALS['tmpl']->assign("page_title", "会员勋章");
     assign_uc_nav_list();
     //左侧导航菜单
     $GLOBALS['tmpl']->display("uc/uc_medal_index.html");
 }
Beispiel #8
0
 public function index()
 {
     require APP_ROOT_PATH . "system/model/uc_center_service.php";
     global_run();
     init_app_page();
     $GLOBALS['tmpl']->assign("no_nav", true);
     //无分类下拉
     if (check_save_login() != LOGIN_STATUS_LOGINED) {
         app_redirect(url("index", "user#login"));
     }
     $page = intval($_REQUEST['p']);
     if ($page <= 0) {
         $page = 1;
     }
     $limit = ($page - 1) * app_conf("PAGE_SIZE") . "," . app_conf("PAGE_SIZE");
     $user_id = intval($GLOBALS['user_info']['id']);
     $result = get_invite_list($limit, $user_id);
     $GLOBALS['tmpl']->assign("list", $result['list']);
     $page = new Page($result['count'], app_conf("PAGE_SIZE"));
     //初始化分页对象
     $p = $page->show();
     $GLOBALS['tmpl']->assign('pages', $p);
     $total_referral_money = $GLOBALS['db']->getOne("select sum(money) from " . DB_PREFIX . "referrals where user_id = " . $GLOBALS['user_info']['id'] . " and pay_time > 0");
     $total_referral_score = $GLOBALS['db']->getOne("select sum(score) from " . DB_PREFIX . "referrals where user_id = " . $GLOBALS['user_info']['id'] . " and pay_time > 0");
     $GLOBALS['tmpl']->assign("total_referral_money", $total_referral_money);
     $GLOBALS['tmpl']->assign("total_referral_score", $total_referral_score);
     $share_url = get_domain() . APP_ROOT . "/";
     if ($GLOBALS['user_info']) {
         $share_url .= "?r=" . base64_encode(intval($GLOBALS['user_info']['id']));
     }
     $GLOBALS['tmpl']->assign("share_url", $share_url);
     $GLOBALS['tmpl']->assign("page_title", "我的邀请");
     assign_uc_nav_list();
     //左侧导航菜单
     $GLOBALS['tmpl']->display("uc/uc_invite.html");
 }
Beispiel #9
0
 /**
  * 兑换
  */
 public function exchange()
 {
     $user_info = $GLOBALS['user_info'];
     //业务逻辑部分
     //分页
     require_once APP_ROOT_PATH . "app/Lib/page.php";
     $page_size = 10;
     $page = intval($_REQUEST['p']);
     if ($page == 0) {
         $page = 1;
     }
     $limit = ($page - 1) * $page_size . "," . $page_size;
     require_once APP_ROOT_PATH . 'system/model/user_center.php';
     //数据
     $GLOBALS['tmpl']->assign("user_info", $user_info);
     $GLOBALS['tmpl']->assign("exchange_data", $this->creditsettings);
     $GLOBALS['tmpl']->assign("exchange_json_data", json_encode($this->creditsettings));
     //通用模版参数定义
     assign_uc_nav_list();
     //左侧导航菜单
     $GLOBALS['tmpl']->assign("no_nav", true);
     //无分类下拉
     $GLOBALS['tmpl']->assign("page_title", "用户uc兑换");
     //title
     $GLOBALS['tmpl']->display("uc/uc_log.html");
     //title
 }
Beispiel #10
0
 public function index()
 {
     global_run();
     init_app_page();
     $GLOBALS['tmpl']->assign("no_nav", true);
     //无分类下拉
     if (check_save_login() != LOGIN_STATUS_LOGINED) {
         app_redirect(url("index", "user#login"));
     }
     $GLOBALS['tmpl']->assign("page_title", "我的信息");
     $user_info = $GLOBALS['user_info'];
     $conditions = " where user_id = " . $user_info['id'];
     $uc_query_data = array();
     if ($_REQUEST['query_type'] == 'score') {
         $query_type = "score";
         //积分信息
         $conditions .= " and score<>0 ";
         $uc_query_data['cur_score'] = $user_info['score'];
         $cur_group = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user_group where id=" . $user_info['group_id']);
         $uc_query_data['cur_gourp'] = $cur_group['id'];
         $uc_query_data['cur_gourp_name'] = $cur_group['name'];
         $uc_query_data['cur_discount'] = doubleval(sprintf('%.2f', $cur_group['discount'] * 10));
     } else {
         $query_type = "point";
         //经验信息
         $conditions .= " and point<>0 ";
         //取出等级信息
         $level_data = load_auto_cache("cache_user_level");
         $cur_level = $level_data[$GLOBALS['user_info']['level_id']];
         //游标移动获取下一个等级
         reset($level_data);
         do {
             $current_data = current($level_data);
             if ($current_data['id'] == $cur_level['id']) {
                 $next_data = next($level_data);
                 break;
             }
         } while (next($level_data));
         $uc_query_data['cur_level'] = $cur_level['level'];
         //当前等级
         $uc_query_data['cur_point'] = $user_info['point'];
         $uc_query_data['cur_level_name'] = $cur_level['name'];
         if ($next_data) {
             $uc_query_data['next_level'] = $next_data['id'];
             $uc_query_data['next_point'] = $next_data['point'] - $user_info['point'];
             //我再增加:100 经验值,就可以升级为:青铜五
             $uc_query_data['next_level_name'] = $next_data['name'];
         }
     }
     //取出多少条数据
     $limit = " limit 0,10 ";
     $list = $GLOBALS['db']->getAll(" select * from " . DB_PREFIX . "user_log " . $conditions . " order by log_time desc " . $limit);
     $uc_query_count = $GLOBALS['db']->getOne(" select count(*) from " . DB_PREFIX . "user_log " . $conditions . " order by id desc " . $limit);
     foreach ($list as $k => $v) {
         $v['log_time'] = to_date($v['log_time']);
         $uc_query_list[] = $v;
     }
     //左侧导航菜单
     assign_uc_nav_list();
     $GLOBALS['tmpl']->assign("uc_query_data", $uc_query_data);
     $GLOBALS['tmpl']->assign("uc_query_list", $uc_query_list);
     $GLOBALS['tmpl']->assign("uc_query_count", $uc_query_count);
     $GLOBALS['tmpl']->assign("query_type", $query_type);
     $GLOBALS['tmpl']->assign("user_info", $user_info);
     $GLOBALS['tmpl']->display("uc/uc_myinfo.html");
 }
Beispiel #11
0
 public function index()
 {
     //==基本参数定义==
     global_run();
     init_app_page();
     $user_info = $GLOBALS['user_info'];
     //==业务逻辑部分==
     if ($GLOBALS['user_info']['is_tmp'] == 1) {
         if (check_save_login() == LOGIN_STATUS_NOLOGIN) {
             app_redirect(url("index", "user#login"));
         }
     } else {
         if (check_save_login() != LOGIN_STATUS_LOGINED) {
             app_redirect(url("index", "user#login"));
         }
     }
     /*第三方微博列表*/
     $iconfont = (require_once APP_ROOT_PATH . 'system/weibo_iconfont_cfg.php');
     $apis = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "api_login");
     foreach ($apis as $k => $v) {
         if ($user_info[strtolower($v['class_name']) . "_id"]) {
             $apis[$k]['is_bind'] = 1;
             if ($user_info["is_syn_" . strtolower($v['class_name'])] == 1) {
                 $apis[$k]['is_syn'] = 1;
             } else {
                 $apis[$k]['is_syn'] = 0;
             }
         } else {
             $apis[$k]['is_bind'] = 0;
         }
         if (file_exists(APP_ROOT_PATH . "system/api_login/" . $v['class_name'] . "_api.php")) {
             require_once APP_ROOT_PATH . "system/api_login/" . $v['class_name'] . "_api.php";
             $api_class = $v['class_name'] . "_api";
             $api_obj = new $api_class($v);
             $api_item = $api_obj->get_bind_api_url_arr();
             $apis[$k]['api_item'] = $api_item;
             $apis[$k]['url'] = $api_url['url'];
             $apis[$k]['iconfont'] = $iconfont[strtolower($v['class_name'])];
         }
     }
     //地区列表
     $region_lv2 = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "region_conf where region_level = 2");
     //二级地址
     foreach ($region_lv2 as $k => $v) {
         if ($v['id'] == intval($GLOBALS['user_info']['province_id'])) {
             $region_lv2[$k]['selected'] = 1;
             break;
         }
     }
     $region_lv3 = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "region_conf where pid = " . intval($GLOBALS['user_info']['province_id']));
     //三级地址
     foreach ($region_lv3 as $k => $v) {
         if ($v['id'] == intval($GLOBALS['user_info']['city_id'])) {
             $region_lv3[$k]['selected'] = 1;
             break;
         }
     }
     //==模版数据申明==
     $GLOBALS['tmpl']->assign("user_info", $GLOBALS['user_info']);
     $GLOBALS['tmpl']->assign("region_lv2", $region_lv2);
     $GLOBALS['tmpl']->assign("region_lv3", $region_lv3);
     $GLOBALS['tmpl']->assign("sms_lesstime", load_sms_lesstime());
     $GLOBALS['tmpl']->assign("sms_ipcount", load_sms_ipcount());
     $GLOBALS['tmpl']->assign("apis", $apis);
     //==通用模版参数定义==
     assign_uc_nav_list();
     //左侧导航菜单
     $GLOBALS['tmpl']->assign("no_nav", true);
     //无分类下拉
     $GLOBALS['tmpl']->assign("page_title", $GLOBALS['lang']['UC_ACCOUNT']);
     $GLOBALS['tmpl']->display("uc/uc_account_index.html");
 }
Beispiel #12
0
 /**
  * 充值
  */
 public function incharge()
 {
     global_run();
     if (check_save_login() != LOGIN_STATUS_LOGINED) {
         app_redirect(url("index", "user#login"));
     }
     init_app_page();
     $user_info = $GLOBALS['user_info'];
     //取出等级信息
     $level_data = load_auto_cache("cache_user_level");
     $cur_level = $level_data[$user_info['level_id']];
     //游标移动获取下一个等级
     reset($level_data);
     do {
         $current_data = current($level_data);
         if ($current_data['id'] == $cur_level['id']) {
             $next_data = next($level_data);
             break;
         }
     } while (next($level_data));
     $uc_query_data = array();
     $uc_query_data['cur_level'] = $cur_level['level'];
     //当前等级
     $uc_query_data['cur_point'] = $user_info['point'];
     $uc_query_data['cur_level_name'] = $cur_level['name'];
     if ($next_data) {
         $uc_query_data['next_level'] = $next_data['id'];
         $uc_query_data['next_point'] = $next_data['point'] - $user_info['point'];
         //我再增加:100 经验值,就可以升级为:青铜五
         $uc_query_data['next_level_name'] = $next_data['name'];
     }
     $uc_query_data['cur_score'] = $user_info['score'];
     $cur_group = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user_group where id=" . $user_info['group_id']);
     $uc_query_data['cur_gourp'] = $cur_group['id'];
     $uc_query_data['cur_gourp_name'] = $cur_group['name'];
     $uc_query_data['cur_discount'] = doubleval(sprintf('%.2f', $cur_group['discount'] * 10));
     $GLOBALS['tmpl']->assign("uc_query_data", $uc_query_data);
     //输出支付方式
     $payment_list = load_auto_cache("cache_payment");
     $icon_paylist = array();
     //用图标展示的支付方式
     //$disp_paylist = array(); //特殊的支付方式(Voucher,Account,Otherpay)
     $bank_paylist = array();
     //网银直连
     foreach ($payment_list as $k => $v) {
         if ($v['class_name'] == "Voucher" || $v['class_name'] == "Account" || $v['class_name'] == "Otherpay" || $v['class_name'] == "tenpayc2c") {
             //$disp_paylist[] = $v;
         } else {
             if ($v['class_name'] == "Alipay") {
                 $cfg = unserialize($v['config']);
                 if ($cfg['alipay_service'] == 2) {
                     if ($v['is_bank'] == 1) {
                         $bank_paylist[] = $v;
                     } else {
                         $icon_paylist[] = $v;
                     }
                 }
             } else {
                 if ($v['is_bank'] == 1) {
                     $bank_paylist[] = $v;
                 } else {
                     $icon_paylist[] = $v;
                 }
             }
         }
     }
     $GLOBALS['tmpl']->assign("icon_paylist", $icon_paylist);
     //$GLOBALS['tmpl']->assign("disp_paylist",$disp_paylist);
     $GLOBALS['tmpl']->assign("bank_paylist", $bank_paylist);
     require_once APP_ROOT_PATH . "system/model/user_center.php";
     require_once APP_ROOT_PATH . "app/Lib/page.php";
     //输出充值订单
     $page = intval($_REQUEST['p']);
     if ($page == 0) {
         $page = 1;
     }
     $limit = ($page - 1) * app_conf("PAGE_SIZE") . "," . app_conf("PAGE_SIZE");
     $result = get_user_incharge($limit, $GLOBALS['user_info']['id']);
     $GLOBALS['tmpl']->assign("list", $result['list']);
     $page = new Page($result['count'], app_conf("PAGE_SIZE"));
     //初始化分页对象
     $p = $page->show();
     $GLOBALS['tmpl']->assign('pages', $p);
     //通用模版参数定义
     assign_uc_nav_list();
     //左侧导航菜单
     $GLOBALS['tmpl']->assign("no_nav", true);
     //无分类下拉
     $GLOBALS['tmpl']->assign("page_title", "会员充值");
     //title
     $GLOBALS['tmpl']->display("uc/uc_money_incharge.html");
     //title
 }
Beispiel #13
0
 public function event_collect()
 {
     global_run();
     init_app_page();
     $GLOBALS['tmpl']->assign("no_nav", true);
     //无分类下拉
     if (check_save_login() != LOGIN_STATUS_LOGINED) {
         app_redirect(url("index", "user#login"));
     }
     $page = intval($_REQUEST['p']);
     if ($page == 0) {
         $page = 1;
     }
     $limit = ($page - 1) * app_conf("PAGE_SIZE") . "," . app_conf("PAGE_SIZE");
     $event_result = get_event_collect($GLOBALS['user_info']['id']);
     foreach ($event_result['list'] as $k => $v) {
         $event_result['list'][$k]['url'] = url('index', 'event#' . $v['id']);
         $event_result['list'][$k]['del_url'] = url('index', 'uc_collect#del', array('id' => $v['cid'], 'type' => 'event'));
     }
     $GLOBALS['tmpl']->assign("list", $event_result['list']);
     $page = new Page($event_result['count'], app_conf("PAGE_SIZE"));
     //初始化分页对象
     $p = $page->show();
     $GLOBALS['tmpl']->assign('pages', $p);
     $GLOBALS['tmpl']->assign("type", "event");
     $GLOBALS['tmpl']->assign("page_title", "我的收藏");
     assign_uc_nav_list();
     //左侧导航菜单
     $GLOBALS['tmpl']->display("uc/uc_collect.html");
 }
Beispiel #14
0
 /**
  * 查看订单内容
  */
 public function view()
 {
     global_run();
     init_app_page();
     $GLOBALS['tmpl']->assign("no_nav", true);
     //无分类下拉
     if (check_save_login() != LOGIN_STATUS_LOGINED) {
         app_redirect(url("index", "user#login"));
     }
     $GLOBALS['tmpl']->assign("page_title", "我的订单");
     assign_uc_nav_list();
     $id = intval($_REQUEST['id']);
     $order_info = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "deal_order where is_delete = 0 and user_id = " . $GLOBALS['user_info']['id'] . " and id = " . $id);
     if ($order_info) {
         if ($order_info['deal_order_item']) {
             $order_info['deal_order_item'] = unserialize($order_info['deal_order_item']);
         } else {
             update_order_cache($order_info['id']);
             $order_info['deal_order_item'] = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "deal_order_item where order_id = " . $order_info['id']);
         }
         $order_info['create_time'] = to_date($order_info['create_time']);
         $order_info['pay_amount_format'] = format_price($order_info['pay_amount']);
         $order_info['total_price_format'] = format_price($order_info['total_price']);
         $order_info['delivery_fee_format'] = format_price($order_info['delivery_fee']);
         $order_info['region_lv1'] = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "delivery_region where id = " . $order_info['region_lv1']);
         $order_info['region_lv2'] = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "delivery_region where id = " . $order_info['region_lv2']);
         $order_info['region_lv3'] = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "delivery_region where id = " . $order_info['region_lv3']);
         $order_info['region_lv4'] = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "delivery_region where id = " . $order_info['region_lv4']);
         $order_info['c'] = count($order_info['deal_order_item']);
         foreach ($order_info['deal_order_item'] as $kk => $vv) {
             $order_info['deal_order_item'][$kk]['total_price'] = format_price($vv['total_price']);
             $deal_info = load_auto_cache("deal", array("id" => $vv['deal_id']));
             $order_info['deal_order_item'][$kk]['url'] = $deal_info['url'];
             $order_info['deal_order_item'][$kk]['forbid_sms'] = $deal_info['forbid_sms'];
             $order_info['deal_order_item'][$kk]['coupon'] = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "deal_coupon where is_valid > 0 and user_id = " . $GLOBALS['user_info']['id'] . " and order_deal_id = " . $vv['id']);
         }
         $order_info['payment'] = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "payment where id = " . $order_info['payment_id']);
         $GLOBALS['tmpl']->assign("order_info", $order_info);
         //输出收款单日志
         $payment_list_res = load_auto_cache("cache_payment");
         foreach ($payment_list_res as $k => $v) {
             $payment_list[$v['id']] = $v;
         }
         $payment_notice_list = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "payment_notice where order_id = " . $order_info['id'] . " and is_paid = 1 order by create_time desc");
         foreach ($payment_notice_list as $k => $v) {
             $payment_notice_list[$k]['payment'] = $payment_list[$v['payment_id']];
         }
         $GLOBALS['tmpl']->assign("payment_notice_list", $payment_notice_list);
         //订单日志
         $order_logs = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "deal_order_log where order_id = " . $order_info['id'] . " order by id desc");
         $GLOBALS['tmpl']->assign("order_logs", $order_logs);
         $GLOBALS['tmpl']->assign("NOW_TIME", NOW_TIME);
         $GLOBALS['tmpl']->display("uc/uc_order_view.html");
     } else {
         showErr("订单不存在");
     }
 }