Esempio n. 1
0
 public function do_exchange()
 {
     global_run();
     if (check_save_login() != LOGIN_STATUS_LOGINED) {
         $result['status'] = 2;
         ajax_return($result);
     }
     $id = intval($_REQUEST['id']);
     $ecv_type = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "ecv_type where id = " . $id);
     if (!$ecv_type) {
         showErr($GLOBALS['lang']['INVALID_VOUCHER'], 1);
     } else {
         $exchange_count = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "ecv where ecv_type_id = " . $id . " and user_id = " . intval($GLOBALS['user_info']['id']));
         if ($ecv_type['exchange_limit'] > 0 && $exchange_count >= $ecv_type['exchange_limit']) {
             $msg = sprintf($GLOBALS['lang']['EXCHANGE_VOUCHER_LIMIT'], $ecv_type['exchange_limit']);
             showErr($msg, 1);
         } elseif ($ecv_type['exchange_score'] > intval($GLOBALS['db']->getOne("select score from " . DB_PREFIX . "user where id = " . intval($GLOBALS['user_info']['id'])))) {
             showErr($GLOBALS['lang']['INSUFFCIENT_SCORE'], 1);
         } else {
             require_once APP_ROOT_PATH . "system/libs/voucher.php";
             $rs = send_voucher($ecv_type['id'], $GLOBALS['user_info']['id'], 1);
             if ($rs) {
                 require_once APP_ROOT_PATH . "system/model/user.php";
                 $msg = sprintf($GLOBALS['lang']['EXCHANGE_VOUCHER_USE_SCORE'], $ecv_type['name'], $ecv_type['exchange_score']);
                 modify_account(array('money' => 0, 'score' => "-" . $ecv_type['exchange_score']), $GLOBALS['user_info']['id'], $msg);
                 showSuccess($GLOBALS['lang']['EXCHANGE_SUCCESS'], 1);
             } else {
                 showSuccess($GLOBALS['lang']['EXCHANGE_FAILED'], 1, url('index', 'uc_voucher'));
             }
         }
     }
 }
Esempio n. 2
0
 public function __construct()
 {
     if (file_exists(APP_ROOT_PATH . "public/uc_config.php")) {
         require_once APP_ROOT_PATH . "public/uc_config.php";
     }
     if (app_conf("INTEGRATE_CODE") == 'Ucenter' && UC_CONNECT == 'mysql') {
         if (file_exists(APP_ROOT_PATH . "public/uc_data/creditsettings.php")) {
             require_once APP_ROOT_PATH . "public/uc_data/creditsettings.php";
             $this->creditsettings = $_CACHE['creditsettings'];
             if (count($this->creditsettings) > 0) {
                 foreach ($this->creditsettings as $k => $v) {
                     $this->creditsettings[$k]['srctitle'] = $this->credits_CFG[$v['creditsrc']]['title'];
                 }
                 $this->allow_exchange = true;
             }
         }
     }
     $GLOBALS['tmpl']->assign("allow_exchange", $this->allow_exchange);
     parent::__construct();
     global_run();
     if (check_save_login() != LOGIN_STATUS_LOGINED) {
         app_redirect(url("index", "user#login"));
     }
     init_app_page();
 }
Esempio n. 3
0
 public function send()
 {
     global_run();
     if (check_save_login() != LOGIN_STATUS_LOGINED) {
         $data['status'] = 1000;
         ajax_return($data);
     } else {
         $t = strim($_REQUEST['t']);
         $id = intval($_REQUEST['id']);
         $youhui_log = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "youhui_log where id = " . $id . " and user_id = " . $GLOBALS['user_info']['id']);
         $youhui_info = load_auto_cache("youhui", array("id" => $youhui_log['youhui_id']));
         if ($youhui_log) {
             if ($youhui_log['confirm_time'] > 0) {
                 $data['status'] = 0;
                 $data['info'] = "优惠券已使用";
                 ajax_return($data);
             } elseif ($youhui_log['expire_time'] > 0 && $youhui_log['expire_time'] < NOW_TIME) {
                 $data['status'] = 0;
                 $data['info'] = "优惠券已过期";
                 ajax_return($data);
             } else {
                 if ($t == "sms") {
                     if (app_conf("SMS_ON") == 0 || $youhui_info['is_sms'] == 0) {
                         $data['status'] = 0;
                         $data['info'] = "不支持短信发送";
                         ajax_return($data);
                     } elseif ($youhui_log['sms_count'] >= app_conf("SMS_COUPON_LIMIT")) {
                         $data['status'] = 0;
                         $data['info'] = "短信发送已超过" . app_conf("SMS_COUPON_LIMIT") . "次";
                         ajax_return($data);
                     } elseif ($GLOBALS['user_info']['mobile'] == "") {
                         $data['status'] = 0;
                         $data['info'] = "请先设置手机号";
                         $data['jump'] = url("index", "uc_account");
                         ajax_return($data);
                     } else {
                         send_youhui_log_sms($id);
                         $GLOBALS['db']->query("update " . DB_PREFIX . "youhui_log set sms_count = sms_count + 1 where id = " . $id);
                         $data['status'] = 1;
                         $data['info'] = "短信成功发送到" . $GLOBALS['user_info']['mobile'] . ",请注意查收。";
                         ajax_return($data);
                     }
                 } else {
                     $data['status'] = 0;
                     $data['info'] = "非法操作";
                     ajax_return($data);
                 }
             }
         } else {
             $data['status'] = 0;
             $data['info'] = "优惠券不存在";
             ajax_return($data);
         }
     }
 }
Esempio n. 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"));
     }
     $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");
 }
Esempio n. 5
0
 public function send()
 {
     global_run();
     if (check_save_login() != LOGIN_STATUS_LOGINED) {
         $data['status'] = 1000;
         ajax_return($data);
     } else {
         $t = strim($_REQUEST['t']);
         $id = intval($_REQUEST['id']);
         $lottery = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "lottery where id = " . $id . " and user_id = " . $GLOBALS['user_info']['id']);
         $deal = load_auto_cache("deal", array("id" => $lottery['deal_id']));
         if ($lottery) {
             if ($t == "sms") {
                 if (app_conf("SMS_ON") == 0 || app_conf("LOTTERY_SN_SMS") == 0) {
                     $data['status'] = 0;
                     $data['info'] = "不支持短信发送";
                     ajax_return($data);
                 } elseif ($lottery['sms_count'] >= app_conf("SMS_COUPON_LIMIT")) {
                     $data['status'] = 0;
                     $data['info'] = "短信发送已超过" . app_conf("SMS_COUPON_LIMIT") . "次";
                     ajax_return($data);
                 } elseif ($GLOBALS['user_info']['mobile'] == "") {
                     $data['status'] = 0;
                     $data['info'] = "请先设置手机号";
                     $data['jump'] = url("index", "uc_account");
                     ajax_return($data);
                 } else {
                     send_lottery_sms($id);
                     $GLOBALS['db']->query("update " . DB_PREFIX . "lottery set sms_count = sms_count + 1 where id = " . $id);
                     $data['status'] = 1;
                     $data['info'] = "短信成功发送到" . $GLOBALS['user_info']['mobile'] . ",请注意查收。";
                     ajax_return($data);
                 }
             } else {
                 $data['status'] = 0;
                 $data['info'] = "非法操作";
                 ajax_return($data);
             }
         } else {
             $data['status'] = 0;
             $data['info'] = "抽奖号不存在";
             ajax_return($data);
         }
     }
 }
Esempio n. 6
0
 public function remove_msg()
 {
     global_run();
     if (check_save_login() != LOGIN_STATUS_LOGINED) {
         $data['status'] = 1000;
         ajax_return($data);
     } else {
         $id = intval($_REQUEST['id']);
         $GLOBALS['db']->query("update " . DB_PREFIX . "msg_box set is_delete = 1 where id = " . $id . " and user_id = " . $GLOBALS['user_info']['id']);
         if ($GLOBALS['db']->affected_rows()) {
             $data['status'] = 1;
             ajax_return($data);
         } else {
             $data['status'] = 0;
             $data['info'] = "删除失败";
             ajax_return($data);
         }
     }
 }
Esempio n. 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");
 }
Esempio n. 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");
 }
Esempio n. 9
0
 public function order_done()
 {
     require_once APP_ROOT_PATH . "system/model/deal.php";
     require_once APP_ROOT_PATH . "system/model/deal_order.php";
     global_run();
     $ajax = 1;
     $user_info = $GLOBALS['user_info'];
     $id = intval($_REQUEST['id']);
     //订单号
     $order = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "deal_order where id = " . $id . " and is_delete = 0 and user_id = " . $user_info['id']);
     if (!$order) {
         showErr($GLOBALS['lang']['INVALID_ORDER_DATA'], $ajax);
     }
     if ($order['refund_status'] == 1) {
         showErr($GLOBALS['lang']['REFUNDING_CANNOT_PAY'], $ajax);
     }
     if ($order['refund_status'] == 2) {
         showErr($GLOBALS['lang']['REFUNDED_CANNOT_PAY'], $ajax);
     }
     $region4_id = intval($_REQUEST['region_lv4']);
     $region3_id = intval($_REQUEST['region_lv3']);
     $region2_id = intval($_REQUEST['region_lv2']);
     $region1_id = intval($_REQUEST['region_lv1']);
     if ($region4_id == 0) {
         if ($region3_id == 0) {
             if ($region2_id == 0) {
                 $region_id = $region1_id;
             } else {
                 $region_id = $region2_id;
             }
         } else {
             $region_id = $region3_id;
         }
     } else {
         $region_id = $region4_id;
     }
     $delivery_id = intval($_REQUEST['delivery']);
     $payment = intval($_REQUEST['payment']);
     $account_money = floatval($_REQUEST['account_money']);
     $all_account_money = intval($_REQUEST['all_account_money']);
     $ecvsn = $_REQUEST['ecvsn'] ? strim($_REQUEST['ecvsn']) : '';
     $ecvpassword = $_REQUEST['ecvpassword'] ? strim($_REQUEST['ecvpassword']) : '';
     $goods_list = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "deal_order_item where order_id = " . $order['id']);
     //验证购物车
     if (check_save_login() != LOGIN_STATUS_LOGINED) {
         showErr($GLOBALS['lang']['PLEASE_LOGIN_FIRST'], $ajax, url("index", "user#login"));
     }
     //验证支付方式的支持
     foreach ($goods_list as $k => $row) {
         if ($GLOBALS['db']->getOne("select define_payment from " . DB_PREFIX . "deal where id = " . $row['deal_id']) == 1) {
             if ($GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "deal_payment where deal_id = " . $row['deal_id'] . " and payment_id = " . $payment)) {
                 showErr($GLOBALS['lang']['INVALID_PAYMENT'], $ajax);
             }
         }
     }
     //结束验证购物车
     $deal_s = $GLOBALS['db']->getAll("select distinct(deal_id) as deal_id from " . DB_PREFIX . "deal_order_item where order_id = " . $order['id']);
     //如果属于未支付的
     if ($order['pay_status'] == 0) {
         foreach ($deal_s as $row) {
             $checker = check_deal_number($row['deal_id'], 0);
             if ($checker['status'] == 0) {
                 showErr($checker['info'] . " " . $GLOBALS['lang']['DEAL_ERROR_' . $checker['data']], $ajax);
             }
         }
         foreach ($goods_list as $k => $v) {
             $checker = check_deal_number_attr($v['deal_id'], $v['attr_str'], 0);
             if ($checker['status'] == 0) {
                 showErr($checker['info'] . " " . $GLOBALS['lang']['DEAL_ERROR_' . $checker['data']], $ajax);
             }
         }
         //验证商品是否过期
         foreach ($deal_s as $row) {
             $checker = check_deal_time($row['deal_id']);
             if ($checker['status'] == 0) {
                 showErr($checker['info'] . " " . $GLOBALS['lang']['DEAL_ERROR_' . $checker['data']], $ajax);
             }
         }
     }
     //开始验证订单接交信息
     require_once APP_ROOT_PATH . "system/model/cart.php";
     $data = count_buy_total($region_id, $delivery_id, $payment, $account_money, $all_account_money, $ecvsn, $ecvpassword, $goods_list, $order['account_money'], $order['ecv_money']);
     if ($data['is_delivery'] == 1) {
         //配送验证
         if (!$data['region_info'] || $data['region_info']['region_level'] != 4) {
             showErr($GLOBALS['lang']['FILL_CORRECT_CONSIGNEE_ADDRESS'], $ajax);
         }
         if (trim($_REQUEST['consignee']) == '') {
             showErr($GLOBALS['lang']['FILL_CORRECT_CONSIGNEE'], $ajax);
         }
         if (trim($_REQUEST['address']) == '') {
             showErr($GLOBALS['lang']['FILL_CORRECT_ADDRESS'], $ajax);
         }
         if (trim($_REQUEST['zip']) == '') {
             showErr($GLOBALS['lang']['FILL_CORRECT_ZIP'], $ajax);
         }
         if (trim($_REQUEST['mobile']) == '') {
             showErr($GLOBALS['lang']['FILL_MOBILE_PHONE'], $ajax);
         }
         if (!check_mobile(trim($_REQUEST['mobile']))) {
             showErr($GLOBALS['lang']['FILL_CORRECT_MOBILE_PHONE'], $ajax);
         }
         if (!$data['delivery_info']) {
             showErr($GLOBALS['lang']['PLEASE_SELECT_DELIVERY'], $ajax);
         }
     }
     if (round($data['pay_price'], 4) > 0 && !$data['payment_info']) {
         showErr($GLOBALS['lang']['PLEASE_SELECT_PAYMENT'], $ajax);
     }
     //结束验证订单接交信息
     //开始修正订单
     $now = NOW_TIME;
     $order['total_price'] = $data['pay_total_price'];
     //应付总额  商品价 - 会员折扣 + 运费 + 支付手续费
     $order['memo'] = strim($_REQUEST['memo']);
     $order['region_lv1'] = intval($_REQUEST['region_lv1']);
     $order['region_lv2'] = intval($_REQUEST['region_lv2']);
     $order['region_lv3'] = intval($_REQUEST['region_lv3']);
     $order['region_lv4'] = intval($_REQUEST['region_lv4']);
     $order['address'] = strim($_REQUEST['address']);
     $order['mobile'] = strim($_REQUEST['mobile']);
     $order['consignee'] = strim($_REQUEST['consignee']);
     $order['zip'] = strim($_REQUEST['zip']);
     $order['delivery_fee'] = $data['delivery_fee'];
     $order['delivery_id'] = $data['delivery_info']['id'];
     $order['payment_id'] = $data['payment_info']['id'];
     $order['payment_fee'] = $data['payment_fee'];
     $order['discount_price'] = $data['user_discount'];
     $order['bank_id'] = strim($_REQUEST['bank_id']);
     $order['promote_description'] = "";
     foreach ($data['promote_description'] as $promote_item) {
         $order['promote_description'] .= $promote_item . "<br />";
     }
     $GLOBALS['db']->autoExecute(DB_PREFIX . "deal_order", $order, 'UPDATE', 'id=' . $order['id'], 'SILENT');
     if ($data['is_delivery'] == 1) {
         //保存收款人
         $consignee_id = intval($_REQUEST['consignee_id']);
         $user_consignee = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user_consignee where user_id = " . $order['user_id'] . " and id = " . $consignee_id);
         $user_consignee['region_lv1'] = intval($_REQUEST['region_lv1']);
         $user_consignee['region_lv2'] = intval($_REQUEST['region_lv2']);
         $user_consignee['region_lv3'] = intval($_REQUEST['region_lv3']);
         $user_consignee['region_lv4'] = intval($_REQUEST['region_lv4']);
         $user_consignee['address'] = strim($_REQUEST['address']);
         $user_consignee['mobile'] = strim($_REQUEST['mobile']);
         $user_consignee['consignee'] = strim($_REQUEST['consignee']);
         $user_consignee['zip'] = strim($_REQUEST['zip']);
         $user_consignee['user_id'] = $order['user_id'];
         if (intval($user_consignee['id']) == 0) {
             //新增,修改订单不新增配送
             // 				$user_consignee['is_default'] = 1;
             // 				$GLOBALS['db']->autoExecute(DB_PREFIX."user_consignee",$user_consignee,'INSERT','','SILENT');
         } else {
             //更新
             $GLOBALS['db']->autoExecute(DB_PREFIX . "user_consignee", $user_consignee, 'UPDATE', 'id=' . $user_consignee['id'], 'SILENT');
             rm_auto_cache("consignee_info", array("consignee_id" => intval($user_consignee['id'])));
         }
     }
     //生成order_id 后
     //1. 余额支付
     $account_money = $data['account_money'];
     if (floatval($account_money) > 0) {
         $account_payment_id = $GLOBALS['db']->getOne("select id from " . DB_PREFIX . "payment where class_name = 'Account'");
         $payment_notice_id = make_payment_notice($account_money, $order['id'], $account_payment_id);
         require_once APP_ROOT_PATH . "system/payment/Account_payment.php";
         $account_payment = new Account_payment();
         $account_payment->get_payment_code($payment_notice_id);
     }
     //3. 相应的支付接口
     $payment_info = $data['payment_info'];
     if ($payment_info && $data['pay_price'] > 0) {
         $payment_notice_id = make_payment_notice($data['pay_price'], $order['id'], $payment_info['id']);
         //创建支付接口的付款单
     }
     $rs = order_paid($order['id']);
     if ($rs) {
         $data = array();
         $data['info'] = "";
         $data['jump'] = url("index", "payment#done", array("id" => $order['id']));
         ajax_return($data);
         //支付成功
     } else {
         distribute_order($order['id']);
         $data = array();
         $data['info'] = "";
         $data['jump'] = url("index", "payment#pay", array("id" => $payment_notice_id));
         ajax_return($data);
     }
 }
Esempio n. 10
0
 public function send()
 {
     global_run();
     if (check_save_login() != LOGIN_STATUS_LOGINED) {
         $data['status'] = 1000;
         ajax_return($data);
     } else {
         $t = strim($_REQUEST['t']);
         $id = intval($_REQUEST['id']);
         $event_submit = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "event_submit where id = " . $id . " and user_id = " . $GLOBALS['user_info']['id']);
         $event_info = load_auto_cache("event", array("id" => $event_submit['event_id']));
         if ($event_submit) {
             if ($event_submit['is_verify'] == 0) {
                 $data['status'] = 0;
                 $data['info'] = "报名未审核";
                 ajax_return($data);
             }
             if ($event_submit['is_verify'] == 2) {
                 $data['status'] = 0;
                 $data['info'] = "报名审核不通过";
                 ajax_return($data);
             } elseif ($event_submit['confirm_time'] > 0) {
                 $data['status'] = 0;
                 $data['info'] = "活动已参加";
                 ajax_return($data);
             } elseif ($event_submit['event_end_time'] > 0 && $event_submit['event_end_time'] < NOW_TIME) {
                 $data['status'] = 0;
                 $data['info'] = "活动已过期";
                 ajax_return($data);
             } else {
                 if ($t == "sms") {
                     if (app_conf("SMS_ON") == 0) {
                         $data['status'] = 0;
                         $data['info'] = "不支持短信发送";
                         ajax_return($data);
                     } elseif ($event_submit['sms_count'] >= app_conf("SMS_COUPON_LIMIT")) {
                         $data['status'] = 0;
                         $data['info'] = "短信发送已超过" . app_conf("SMS_COUPON_LIMIT") . "次";
                         ajax_return($data);
                     } elseif ($GLOBALS['user_info']['mobile'] == "") {
                         $data['status'] = 0;
                         $data['info'] = "请先设置手机号";
                         $data['jump'] = url("index", "uc_account");
                         ajax_return($data);
                     } else {
                         send_event_sn_sms($id);
                         $GLOBALS['db']->query("update " . DB_PREFIX . "event_submit set sms_count = sms_count + 1 where id = " . $id);
                         $data['status'] = 1;
                         $data['info'] = "短信成功发送到" . $GLOBALS['user_info']['mobile'] . ",请注意查收。";
                         ajax_return($data);
                     }
                 } elseif ($t == "mail") {
                     if (app_conf("MAIL_ON") == 0) {
                         $data['status'] = 0;
                         $data['info'] = "不支持邮件发送";
                         ajax_return($data);
                     } elseif ($event_submit['mail_count'] >= app_conf("MAIL_COUPON_LIMIT")) {
                         $data['status'] = 0;
                         $data['info'] = "邮件发送已超过" . app_conf("MAIL_COUPON_LIMIT") . "次";
                         ajax_return($data);
                     } elseif ($GLOBALS['user_info']['email'] == "") {
                         $data['status'] = 0;
                         $data['info'] = "请先设置邮箱";
                         $data['jump'] = url("index", "uc_account");
                         ajax_return($data);
                     } else {
                         send_event_sn_mail($id);
                         $GLOBALS['db']->query("update " . DB_PREFIX . "event_submit set mail_count = mail_count + 1 where id = " . $id);
                         $data['status'] = 1;
                         $data['info'] = "邮件成功发送到" . $GLOBALS['user_info']['email'] . ",请注意查收。";
                         ajax_return($data);
                     }
                 } else {
                     $data['status'] = 0;
                     $data['info'] = "非法操作";
                     ajax_return($data);
                 }
             }
         } else {
             $data['status'] = 0;
             $data['info'] = "报名数据不存在";
             ajax_return($data);
         }
     }
 }
Esempio n. 11
0
 public function del()
 {
     global_run();
     $id = intval($_REQUEST['id']);
     $type = strim($_REQUEST['type']);
     if (check_save_login() != LOGIN_STATUS_LOGINED) {
         $result['status'] = 2;
         ajax_return($result);
     }
     if ($type == 'deal') {
         $table = 'deal_collect';
         $field = 'user_id';
     } elseif ($type == 'youhui') {
         $table = 'youhui_sc';
         $field = 'uid';
     } elseif ($type == 'event') {
         $table = 'event_sc';
         $field = 'uid';
     } else {
         showErr($GLOBALS['lang']['INVALID_COLLECT'], 1);
     }
     $GLOBALS['db']->query("delete from " . DB_PREFIX . $table . " where id = " . $id . " and " . $field . " = " . intval($GLOBALS['user_info']['id']));
     if ($GLOBALS['db']->affected_rows()) {
         showSuccess($GLOBALS['lang']['DELETE_SUCCESS'], 1);
     } else {
         showErr($GLOBALS['lang']['INVALID_COLLECT'], 1);
     }
 }
Esempio n. 12
0
 public function save()
 {
     global_run();
     require_once APP_ROOT_PATH . 'system/model/user.php';
     foreach ($_REQUEST as $k => $v) {
         $_REQUEST[$k] = strim($v);
     }
     $data = array();
     $data['error'] = 0;
     $data['info'] = '';
     if ($GLOBALS['user_info']['is_tmp'] == 1) {
         if (check_save_login() == LOGIN_STATUS_NOLOGIN) {
             $data['error'] = 1000;
             ajax_return($data);
         }
         //临时会员必需有密码
         $current_password = strim($_REQUEST['current_password']);
         if (md5($current_password . $GLOBALS['user_info']['code']) != $GLOBALS['user_info']['user_pwd'] && strim($_REQUEST['user_pwd']) == "") {
             $data['error'] = 1;
             $data['info'] = "请输入您的密码";
             ajax_return($data);
         }
         if ($GLOBALS['user_info']['user_name'] == "" && $_REQUEST['user_name'] == "") {
             $data['error'] = 1;
             $data['info'] = "请输入您的用户名";
             ajax_return($data);
         }
         if ($GLOBALS['user_info']['email'] == "" && $_REQUEST['email'] == "") {
             $data['error'] = 1;
             $data['info'] = "请输入您的真实邮箱";
             ajax_return($data);
         }
     } else {
         if (check_save_login() != LOGIN_STATUS_LOGINED) {
             $data['error'] = 1000;
             ajax_return($data);
         }
         //用户有修改密码
         if (strim($_REQUEST['user_pwd']) != '' && strim($_REQUEST['user_pwd_confirm']) != '') {
             if (strim($_REQUEST['current_password']) == '') {
                 $data['error'] = 1;
                 $data['info'] = "修改密码,必须输入当前密码进行验证!";
                 ajax_return($data);
             } elseif (strim($_REQUEST['current_password']) != '' && md5(strim($_REQUEST['current_password']) . $GLOBALS['user_info']['code']) != $GLOBALS['user_info']['user_pwd']) {
                 $data['error'] = 1;
                 $data['info'] = "当前密码错误,无法修改密码!";
                 ajax_return($data);
             }
         }
     }
     $account_mobile = $_REQUEST['mobile'];
     $sms_verify = $_REQUEST['sms_verify'];
     if ($account_mobile != '' && $account_mobile != $GLOBALS['user_info']['mobile']) {
         if ($_REQUEST['mobile'] == "") {
             $data['error'] = 1;
             $data['info'] = "请输入手机号";
             ajax_return($data);
         }
         if (strim($_REQUEST['current_password']) == '') {
             $data['error'] = 1;
             $data['info'] = "修改手机号,必须输入当前密码进行验证!";
             ajax_return($data);
         } elseif (strim($_REQUEST['current_password']) != '' && md5(strim($_REQUEST['current_password']) . $GLOBALS['user_info']['code']) != $GLOBALS['user_info']['user_pwd']) {
             $data['error'] = 1;
             $data['info'] = "当前密码错误,无法修改密码!";
             ajax_return($data);
         }
         if (app_conf("SMS_ON") == 1) {
             if ($_REQUEST['sms_verify'] == "") {
                 $data['error'] = 1;
                 $data['info'] = "请输入收到的验证码";
                 ajax_return($data);
             }
             //短信码验证
             $sql = "DELETE FROM " . DB_PREFIX . "sms_mobile_verify WHERE add_time <=" . (NOW_TIME - SMS_EXPIRESPAN);
             $GLOBALS['db']->query($sql);
             $mobile_data = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "sms_mobile_verify where mobile_phone = '" . $account_mobile . "'");
             if ($mobile_data['code'] != $sms_verify) {
                 $data['error'] = 1;
                 $data['info'] = "验证码错误";
                 ajax_return($data);
             }
         }
     }
     /*
     if($GLOBALS['user_info']['user_name'])
     	$_REQUEST['user_name'] = $GLOBALS['user_info']['user_name'];
     if($GLOBALS['user_info']['email'])
     	$_REQUEST['email'] = $GLOBALS['user_info']['email'];
     */
     unset($_REQUEST['is_check_mobile']);
     unset($_REQUEST['sms_verify']);
     $_REQUEST['id'] = $GLOBALS['user_info']['id'];
     $res = save_user($_REQUEST, 'UPDATE');
     if ($res['status'] == 1) {
         $GLOBALS['db']->query("delete from " . DB_PREFIX . "sms_mobile_verify where mobile_phone = '" . $account_mobile . "'");
         $s_user_info = es_session::get("user_info");
         $user_info = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user where id = '" . intval($s_user_info['id']) . "'");
         es_session::set("user_info", $user_info);
         if (intval($_REQUEST['is_ajax']) == 1) {
             $data['jump'] = url("index", "uc_account#index");
             ajax_return($data);
         } else {
             showSuccess($GLOBALS['lang']['SAVE_USER_SUCCESS']);
         }
     } else {
         $error = $res['data'];
         if (!$error['field_show_name']) {
             $error['field_show_name'] = $GLOBALS['lang']['USER_TITLE_' . strtoupper($error['field_name'])];
         }
         if ($error['error'] == EMPTY_ERROR) {
             $error_msg = sprintf($GLOBALS['lang']['EMPTY_ERROR_TIP'], $error['field_show_name']);
         }
         if ($error['error'] == FORMAT_ERROR) {
             $error_msg = sprintf($GLOBALS['lang']['FORMAT_ERROR_TIP'], $error['field_show_name']);
         }
         if ($error['error'] == EXIST_ERROR) {
             $error_msg = sprintf($GLOBALS['lang']['EXIST_ERROR_TIP'], $error['field_show_name']);
         }
         $data['error'] = 1;
         $data['info'] = $error_msg;
         if (intval($_REQUEST['is_ajax']) == 1) {
             ajax_return($data);
         } else {
             showErr($data);
         }
     }
 }
Esempio n. 13
0
 public function incharge_done()
 {
     global_run();
     init_app_page();
     if (check_save_login() != LOGIN_STATUS_LOGINED) {
         app_redirect(url("index", "user#login"));
     }
     $payment_id = intval($_REQUEST['payment']);
     $money = floatval($_REQUEST['money']);
     if ($money <= 0) {
         showErr($GLOBALS['lang']['PLEASE_INPUT_CORRECT_INCHARGE']);
     }
     $payment_info = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "payment where id = " . $payment_id);
     if (!$payment_info) {
         showErr($GLOBALS['lang']['PLEASE_SELECT_PAYMENT']);
     }
     if ($payment_info['fee_type'] == 0) {
         $payment_fee = $payment_info['fee_amount'];
     } else {
         $payment_fee = $money * $payment_info['fee_amount'];
     }
     //开始生成订单
     $now = NOW_TIME;
     $order['type'] = 1;
     //充值单
     $order['user_id'] = $GLOBALS['user_info']['id'];
     $order['create_time'] = $now;
     $order['total_price'] = $money + $payment_fee;
     $order['deal_total_price'] = $money;
     $order['pay_amount'] = 0;
     $order['pay_status'] = 0;
     $order['delivery_status'] = 5;
     $order['order_status'] = 0;
     $order['payment_id'] = $payment_id;
     $order['payment_fee'] = $payment_fee;
     $order['bank_id'] = strim($_REQUEST['bank_id']);
     do {
         $order['order_sn'] = to_date(get_gmtime(), "Ymdhis") . rand(100, 999);
         $GLOBALS['db']->autoExecute(DB_PREFIX . "deal_order", $order, 'INSERT', '', 'SILENT');
         $order_id = intval($GLOBALS['db']->insert_id());
     } while ($order_id == 0);
     require_once APP_ROOT_PATH . "system/model/cart.php";
     $payment_notice_id = make_payment_notice($order['total_price'], $order_id, $payment_info['id']);
     //创建支付接口的付款单
     $rs = order_paid($order_id);
     if ($rs) {
         app_redirect(url("index", "payment#incharge_done", array("id" => $order_id)));
         //充值支付成功
     } else {
         app_redirect(url("index", "payment#pay", array("id" => $payment_notice_id)));
     }
 }
Esempio n. 14
0
 public function send()
 {
     global_run();
     if (check_save_login() != LOGIN_STATUS_LOGINED) {
         $data['status'] = 1000;
         ajax_return($data);
     } else {
         $t = strim($_REQUEST['t']);
         $id = intval($_REQUEST['id']);
         $coupon = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "deal_coupon where id = " . $id . " and user_id = " . $GLOBALS['user_info']['id'] . " and is_valid = 1");
         $deal_info = load_auto_cache("deal", array("id" => $coupon['deal_id']));
         if ($coupon) {
             if ($coupon['refund_status'] == 1) {
                 $data['status'] = 0;
                 $data['info'] = "团购券退款审核中";
                 ajax_return($data);
             } elseif ($coupon['refund_status'] == 2) {
                 $data['status'] = 0;
                 $data['info'] = "团购券已退款";
                 ajax_return($data);
             } elseif ($coupon['confirm_time'] > 0) {
                 $data['status'] = 0;
                 $data['info'] = "团购券已使用";
                 ajax_return($data);
             } elseif ($coupon['end_time'] > 0 && $coupon['end_time'] < NOW_TIME) {
                 $data['status'] = 0;
                 $data['info'] = "团购券已过期";
                 ajax_return($data);
             } else {
                 if ($t == "sms") {
                     if ($deal_info['forbid_sms'] == 1 || app_conf("SMS_ON") == 0 || app_conf("SMS_SEND_COUPON") == 0) {
                         $data['status'] = 0;
                         $data['info'] = "不支持短信发送";
                         ajax_return($data);
                     } elseif ($coupon['sms_count'] >= app_conf("SMS_COUPON_LIMIT")) {
                         $data['status'] = 0;
                         $data['info'] = "短信发送已超过" . app_conf("SMS_COUPON_LIMIT") . "次";
                         ajax_return($data);
                     } elseif ($GLOBALS['user_info']['mobile'] == "") {
                         $data['status'] = 0;
                         $data['info'] = "请先设置手机号";
                         $data['jump'] = url("index", "uc_account");
                         ajax_return($data);
                     } else {
                         send_deal_coupon_sms($id);
                         $GLOBALS['db']->query("update " . DB_PREFIX . "deal_coupon set sms_count = sms_count + 1 where id = " . $id);
                         $data['status'] = 1;
                         $data['info'] = "短信成功发送到" . $GLOBALS['user_info']['mobile'] . ",请注意查收。";
                         ajax_return($data);
                     }
                 } elseif ($t == "mail") {
                     if (app_conf("MAIL_ON") == 0 || app_conf("MAIL_SEND_COUPON") == 0) {
                         $data['status'] = 0;
                         $data['info'] = "不支持邮件发送";
                         ajax_return($data);
                     } elseif ($coupon['mail_count'] >= app_conf("MAIL_COUPON_LIMIT")) {
                         $data['status'] = 0;
                         $data['info'] = "邮件发送已超过" . app_conf("MAIL_COUPON_LIMIT") . "次";
                         ajax_return($data);
                     } elseif ($GLOBALS['user_info']['email'] == "") {
                         $data['status'] = 0;
                         $data['info'] = "请先设置邮箱";
                         $data['jump'] = url("index", "uc_account");
                         ajax_return($data);
                     } else {
                         send_deal_coupon_mail($id);
                         $GLOBALS['db']->query("update " . DB_PREFIX . "deal_coupon set mail_count = mail_count + 1 where id = " . $id);
                         $data['status'] = 1;
                         $data['info'] = "邮件成功发送到" . $GLOBALS['user_info']['email'] . ",请注意查收。";
                         ajax_return($data);
                     }
                 } else {
                     $data['status'] = 0;
                     $data['info'] = "非法操作";
                     ajax_return($data);
                 }
             }
         } else {
             $data['status'] = 0;
             $data['info'] = "团购券不存在";
             ajax_return($data);
         }
     }
 }
Esempio n. 15
0
 public function modify_consignee()
 {
     global_run();
     if (check_save_login() != LOGIN_STATUS_LOGINED) {
         $data['status'] = 1000;
         ajax_return($data);
     }
     $user_id = intval($GLOBALS['user_info']['id']);
     //输出所有配送方式
     $consignee_list = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "user_consignee where user_id = " . $user_id);
     if ($consignee_list) {
         foreach ($consignee_list as $k => $v) {
             $consignee_list[$k]['region_lv2'] = $GLOBALS['db']->getOne("select name from " . DB_PREFIX . "delivery_region where id = " . $v['region_lv2']);
             $consignee_list[$k]['region_lv3'] = $GLOBALS['db']->getOne("select name from " . DB_PREFIX . "delivery_region where id = " . $v['region_lv3']);
             $consignee_list[$k]['region_lv4'] = $GLOBALS['db']->getOne("select name from " . DB_PREFIX . "delivery_region where id = " . $v['region_lv4']);
         }
         $GLOBALS['tmpl']->assign("consignee_list", $consignee_list);
         $data['html'] = $GLOBALS['tmpl']->fetch("inc/uc_consignee.html");
         $data['status'] = 1;
         ajax_return($data);
     } else {
         $data['info'] = "没有预设的配送地址";
         $data['status'] = 0;
         ajax_return($data);
     }
 }
Esempio n. 16
0
 public function set_default()
 {
     global_run();
     if (check_save_login() != LOGIN_STATUS_LOGINED) {
         $result['status'] = 2;
         ajax_return($result);
     }
     $id = intval($_REQUEST['id']);
     $GLOBALS['db']->query("update " . DB_PREFIX . "user_consignee set is_default=0 where user_id=" . intval($GLOBALS['user_info']['id']));
     $GLOBALS['db']->query("update " . DB_PREFIX . "user_consignee set is_default=1 where id=" . $id . " and user_id=" . intval($GLOBALS['user_info']['id']));
     if ($GLOBALS['db']->affected_rows()) {
         showSuccess("设置成功", 1);
     } else {
         showErr("操作失败", 1);
     }
 }
Esempio n. 17
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");
 }
Esempio n. 18
0
 /**
  * 退款申请
  */
 public function do_refund()
 {
     global_run();
     if (check_save_login() != LOGIN_STATUS_LOGINED) {
         $data['status'] = 1000;
         ajax_return($data);
     } else {
         $did = intval($_REQUEST['did']);
         $cid = intval($_REQUEST['cid']);
         $content = strim($_REQUEST['content']);
         if (empty($content)) {
             $data['status'] = 0;
             $data['info'] = "请填写退款原因";
             ajax_return($data);
         }
         if ($did) {
             //退单
             $deal_order_item = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "deal_order_item where id = " . $did);
             $order_info = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "deal_order where id = '" . $deal_order_item['order_id'] . "' and order_status = 0 and user_id = " . $GLOBALS['user_info']['id']);
             if ($order_info) {
                 if ($deal_order_item['delivery_status'] == 0 && $order_info['pay_status'] == 2 && $deal_order_item['is_refund'] == 1) {
                     if ($deal_order_item['refund_status'] == 0) {
                         //执行退单,标记:deal_order_item表与deal_order表,
                         $GLOBALS['db']->query("update " . DB_PREFIX . "deal_order_item set refund_status = 1 where id = " . $deal_order_item['id']);
                         $GLOBALS['db']->query("update " . DB_PREFIX . "deal_order set refund_status = 1 where id = " . $deal_order_item['order_id']);
                         $msg = array();
                         $msg['rel_table'] = "deal_order";
                         $msg['rel_id'] = $deal_order_item['order_id'];
                         $msg['title'] = "退款申请";
                         $msg['content'] = "退款申请:" . $content;
                         $msg['create_time'] = NOW_TIME;
                         $msg['user_id'] = $GLOBALS['user_info']['id'];
                         $GLOBALS['db']->autoExecute(DB_PREFIX . "message", $msg);
                         update_order_cache($deal_order_item['order_id']);
                         order_log($deal_order_item['sub_name'] . "申请退款,等待审核", $deal_order_item['order_id']);
                         require_once APP_ROOT_PATH . "system/model/deal_order.php";
                         distribute_order($order_info['id']);
                         $data['status'] = true;
                         $data['info'] = "退款申请已提交,请等待审核";
                         ajax_return($data);
                     } else {
                         $data['status'] = 0;
                         $data['info'] = "不允许退款";
                         ajax_return($data);
                     }
                 } else {
                     $data['status'] = 0;
                     $data['info'] = "非法操作";
                     ajax_return($data);
                 }
             } else {
                 $data['status'] = 0;
                 $data['info'] = "非法操作";
                 ajax_return($data);
             }
         } elseif ($cid) {
             //退券
             $coupon = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "deal_coupon where user_id = " . $GLOBALS['user_info']['id'] . " and id = " . $cid);
             if ($coupon) {
                 if ($coupon['refund_status'] == 0 && $coupon['confirm_time'] == 0) {
                     if ($coupon['any_refund'] == 1 || $coupon['expire_refund'] == 1 && $coupon['end_time'] > 0 && $coupon['end_time'] < NOW_TIME) {
                         //执行退券
                         $GLOBALS['db']->query("update " . DB_PREFIX . "deal_coupon set refund_status = 1 where id = " . $coupon['id']);
                         $GLOBALS['db']->query("update " . DB_PREFIX . "deal_order_item set refund_status = 1 where id = " . $coupon['order_deal_id']);
                         $GLOBALS['db']->query("update " . DB_PREFIX . "deal_order set refund_status = 1 where id = " . $coupon['order_id']);
                         $deal_order_item = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "deal_order_item where id = " . $coupon['order_deal_id']);
                         $msg = array();
                         $msg['rel_table'] = "deal_order";
                         $msg['rel_id'] = $coupon['order_id'];
                         $msg['title'] = "退款申请";
                         $msg['content'] = $content;
                         $msg['create_time'] = NOW_TIME;
                         $msg['user_id'] = $GLOBALS['user_info']['id'];
                         $GLOBALS['db']->autoExecute(DB_PREFIX . "message", $msg);
                         update_order_cache($coupon['order_id']);
                         order_log($deal_order_item['sub_name'] . "申请退一张团购券,等待审核", $coupon['order_id']);
                         require_once APP_ROOT_PATH . "system/model/deal_order.php";
                         distribute_order($coupon['order_id']);
                         $data['status'] = true;
                         $data['info'] = "退款申请已提交,请等待审核";
                         ajax_return($data);
                     } else {
                         $data['status'] = 0;
                         $data['info'] = "不允许退款";
                         ajax_return($data);
                     }
                 } else {
                     $data['status'] = 0;
                     $data['info'] = "非法操作";
                     ajax_return($data);
                 }
             } else {
                 $data['status'] = 0;
                 $data['info'] = "非法操作";
                 ajax_return($data);
             }
         } else {
             $data['status'] = 0;
             $data['info'] = "非法操作";
             ajax_return($data);
         }
     }
 }