// $order_all = $db->getAll("SELECT * FROM ".$ecs->table('order_info')." WHERE user_id='$user_id'"); // foreach ($order_all[0] as $key => $val) { // if ($order_all[0][$key] == $order_all[1][$key]) { // unset($order_all[0][$key]); // unset($order_all[1][$key]); // } // } // $sql = "SELECT COUNT(*) FROM " .$ecs->table('order_info'). " WHERE user_id = '$user_id'". GZ_order_query_sql($type); // print_r($sql);exit; $pager = get_pager('user.php', array('act' => $action), $record_count, $page, $page_parm['count']); $orders = GZ_get_user_orders($user_id, $pager['size'], $pager['start'], $type); // print_r($orders);exit; foreach ($orders as $key => $value) { unset($orders[$key]['order_status']); $orders[$key]['order_time'] = formatTime($value['order_time']); $goods_list = GZ_order_goods($value['order_id']); //$orders[$key]['ss'] = $goods_list; $goods_list_t = array(); // $goods_list = API_DATA("SIMPLEGOODS", $goods_list); foreach ($goods_list as $v) { $goods_list_t[] = array("goods_id" => $v['goods_id'], "name" => $v['goods_name'], "goods_number" => $v['goods_number'], "subtotal" => price_format($v['subtotal'], false), "formated_shop_price" => price_format($v['goods_price'], false), "img" => array('small' => API_DATA('PHOTO', $v['goods_thumb']), 'thumb' => API_DATA('PHOTO', $v['goods_img']), 'url' => API_DATA('PHOTO', $v['original_img']))); } $orders[$key]['goods_list'] = $goods_list_t; $order_detail = get_order_detail($value['order_id'], $user_id); $orders[$key]['formated_integral_money'] = $order_detail['formated_integral_money']; //积分 钱 $orders[$key]['formated_bonus'] = $order_detail['formated_bonus']; //红包 钱 $orders[$key]['formated_shipping_fee'] = $order_detail['formated_shipping_fee']; //运送费 if ($order_detail['pay_id'] > 0) {
$inputParams = array(); if (!empty($_POST['json'])) { if (!get_magic_quotes_gpc()) { $_POST['json'] = stripslashes($_POST['json']); } $inputParams = json_decode($_POST['json'], true); } $order_id = $inputParams['order_id']; $order = order_info($order_id); //获取提交的商品价格 //log_result(var_export($order,true)); $order_price = trim($order['total_fee']); if ($order_price == '') { $order_price = '1'; } $goods_list = GZ_order_goods($order_id); $product_name = $goods_list[0]['goods_name'] . '等' . count($goods_list) . '种商品'; //获取提交的商品名称 暂无 如有需要可以添加 if ($product_name == '') { $product_name = '测试商品名称'; } $regex = "/\\/|\\~|\\!|\\@|\\#|\\\$|\\%|\\^|\\&|\\*|\\(|\\)|\\_|\\+|\\{|\\}|\\:|\\<|\\>|\\?|\\[|\\]|\\,|\\.|\\/|\\;|\\'|\\`|\\-|\\=|\\\\|\\|/"; $product_name = preg_replace($regex, "", $product_name); //获取提交的订单号 $out_trade_no = trim($order['order_sn']); if ($out_trade_no == '') { $out_trade_no = time(); } $device_info = trim($inputParams['device_info'] ? $inputParams['device_info'] : ''); $outparams = array(); //商品价格(包含运费),以分为单位