function showOrderStatus($status) { $order_status = getOrderStatus(); switch ($status) { case $order_status['deal']: return "已下单"; break; case $order_status['paid']: return "已付款"; break; case $order_status['delivered']: return "已发货"; break; case $order_status['success']: return "交易完成"; break; case $order_status['closed']: return "已关闭"; break; } }
public function cancel() { needLogin(); $id = $this->_get('id', 'intval'); $uid = getUserId(); $model = D("DealOrder"); $order = $model->where("id={$id}")->find(); if (!$order) { $this->error("参数错误:不存在的订单!"); } if ($order['uid'] != $uid) { $this->error("无权操作"); } $order_status = getOrderStatus(); //只有已下单状态的订单可以取消 if ($order['status'] == $order_status['deal']) { $detail_model = D("DealOrderDetail"); $detail_model->where("oid='{$id}'")->delete(); $model->where("id={$id}")->delete(); $this->success("取消成功", __URL__); } else { $this->error("无法取消改订单:订单状态不允许取消。"); } }
<?php while ($ordRow = mysql_fetch_array($orderResult)) { $orderTotal = $ordRow["total"]; $link = 'vieworder.php?orderid=' . $ordRow["order_id"]; ?> <tr> <td valign="top" align="left"><?php echo htmlentities($ordRow["order_id"]); ?> </td> <td valign="top" align="left"><?php echo printElement($ordRow["user_name"]); ?> </td> <td valign="top" align="left"><?php echo getOrderStatus($ordRow["order_id"]); ?> </td> <td valign="top" align="left"><?php echo dateFormat($ordRow["order_date"], "Y-m-d", "m/d/Y"); ?> </td> <td valign="top" align="left"><?php echo $adminSymbol; ?> <?php echo htmlentities(number_format($orderTotal, 2, '.', '')); ?> </td> <td><a href="<?php echo $link;
/** * 获取用户指定范围的订单列表 chen-0915 * * @access public * @param int $user_id 用户ID号 * @param int $num 列表最大数量 * @param int $start 列表起始位置 * @param string $where 不同定单的判断条件 * @param int $comment 完成的订单,是否评论的标记。1:已评价,2:待评价 * @param int $all * @return array $order_list 订单列表 */ function get_all_orders($user_id, $num = 10, $start = 0, $where = '', $comment = 0, $all = 0) { include_once ROOT_PATH . 'includes/lib_sundries.php'; /* 取得订单列表 */ $arr = array(); $sql = "SELECT order_id, order_sn, discount, order_status, shipping_status, pay_status,shipping_fee, add_time, integral, tax, " . "(goods_amount + shipping_fee + insure_fee + pay_fee + pack_fee + card_fee + tax - discount) AS total_fee " . " FROM " . $GLOBALS['ecs']->table('order_info') . " WHERE user_id = '{$user_id}' " . $where . " ORDER BY add_time DESC"; switch ($all) { case 0: $res = $GLOBALS['db']->SelectLimit($sql, $num, $start); break; case 1: $res = $GLOBALS['db']->SelectLimit($sql, 1000, 0); break; } while ($row = $GLOBALS['db']->fetchRow($res)) { $goods_sql = "select goods_id,goods_name,goods_attr,goods_number,send_number,goods_price,packageBuyId,packageBuyDiscount from " . $GLOBALS['ecs']->table('order_goods') . " where order_id = " . $row['order_id'] . " order by packageBuyId asc"; $goods_res = $GLOBALS['db']->getAll($goods_sql); $row['goods_id_list'] = ''; $row['goods_name_list'] = ''; $row['packageBuyDiscountMoney'] = 0.0; $row['goods_number'] = 0; for ($i = 0; $i < count($goods_res); $i++) { if ($i == 0) { $row['goods_id_list'] = $goods_res[$i]['goods_id']; $row['goods_name_list'] = $goods_res[$i]['goods_name']; } else { $row['goods_id_list'] .= ',' . $goods_res[$i]['goods_id']; $row['goods_name_list'] .= ',' . $goods_res[$i]['goods_name']; } $thumb_sql = "select goods_thumb from " . $GLOBALS['ecs']->table('goods') . " where goods_id = " . $goods_res[$i]['goods_id']; $thumb = $GLOBALS['db']->getAll($thumb_sql); $goods_res[$i]['url'] = build_uri('goods', array('gid' => $goods_res[$i]['goods_id']), $goods_res[$i]['goods_name']); $goods_res[$i]['goods_thumb'] = $thumb[0]['goods_thumb']; $goods_res[$i]['packageBuy_id'] = $goods_res[$i]['packageBuyId']; unset($goods_res[$i]['packageBuyId']); calcPackageBuyVal($i, $goods_res); //$goods_res[$i]['packageBuy'] = $goods_res[$i]['packageBuyDiscount'] = strval($goods_res[$i]['packageBuyDiscount']); if ($goods_res[$i]['packageBuy_id'] != 0) { $row['packageBuyDiscountMoney'] += floatval($goods_res[$i]['goods_price']) * $goods_res[$i]['goods_number']; } $row['goods_number'] += $goods_res[$i]['goods_number']; } $row['packageBuyDiscountMoney'] *= 1.0 - floatval($goods_res[0]['packageBuyDiscount']); $row['goods'] = $goods_res; $row['shipping_status'] = $row['shipping_status'] == SS_SHIPPED_ING ? SS_PREPARING : $row['shipping_status']; $row['status'] = getOrderStatus($row['order_status'], $row['shipping_status'], $row['pay_status'], $comment, $row['order_id']); if ($row['status'] == '-1') { continue; } //$tmp = $row['order_status']; $row['order_status'] = $GLOBALS['_LANG']['os'][$row['order_status']] . ',' . $GLOBALS['_LANG']['ps'][$row['pay_status']] . ',' . $GLOBALS['_LANG']['ss'][$row['shipping_status']]; /* if($row['order_status'] == '已确认,已付款,配货中' ) { echo $tmp." ".$row['shipping_status']." ".$row['pay_status']."<br/>"; echo $row['status']."<br/>"; } */ $row['one_goods_name'] = getOrderOneGoodName($row['goods_name_list']); $row['one_goods_id'] = getOrderOneGoodId($row['goods_id_list']); $row['packageBuyDiscountRate'] = intval($goods_res[0]['packageBuyDiscount'] * 10); $arr[] = array('order_id' => $row['order_id'], 'integral' => $row['integral'], 'packageBuyDiscountRate' => $row['packageBuyDiscountRate'], 'packageBuyDiscountMoney' => price_format($row['packageBuyDiscountMoney']), 'discount' => price_format($row['discount']), 'order_sn' => $row['order_sn'], 'order_time' => local_date('Y-m-d', $row['add_time']), 'order_status' => $row['order_status'], 'status' => $row['status'], 'goods_number' => $row['goods_number'], 'shipping_fee' => $row['shipping_fee'], 'total_fee' => price_format($row['total_fee'], false), 'goods' => $row['goods'], 'goods_id_list' => $row['goods_id_list'], 'one_goods_id' => $row['one_goods_id'], 'goods_name_list' => $row['goods_name_list'], 'one_goods_name' => $row['one_goods_name'], 'tax' => $row['tax'], 'one_goods_thumb' => $row['goods'][0]['goods_thumb']); } return $arr; }
<td colspan="5" align="right"><b>Order Total :</b></td> <td class="text_information"><b><?php echo $adminCurrency['currency_symbol']; ?> <?php echo number_format($grand_total, 2, ".", ""); ?> </b></td> <td> </td> <td> </td> </tr> <?php if (isNotNull($check)) { /*----------Multicart 2.0 Upgradation-----------------------*/ if ($rw["order_status"] != "Cancelled" && getOrderStatus($orderid) != 'Delivered') { ?> <tr align="left" valign="middle" class="whitebg"> <td colspan="8" class="btn_gotbl">Change Order Status to: <?php echo makeDropDownList("ddlStatus", $statlist, $ddlStatus, false, "textarea2", $properties, $behaviors); ?> <input name="chkStatus" type="checkbox" id="chkStatus" value="Y"> Inform Order Staus Change To Buyer <input type="submit" name="btnGo" value="Go" class="button" > </td> </tr> <tr align="left" valign="middle" class="whitebg"> <td colspan="8" class="btn_gotbl"> </td> </tr> <?php }
if ($row['typeid'] != 2) { $totalprice = $row['dingnum'] * $row['price'] + $row['childnum'] * $row['childprice'] + $row['oldnum'] * $row['oldprice']; } else { if ($row['haschild'] == 1) { $childOrder = getChildOrderInfo($row['id']); $totalprice = 0; foreach ($childOrder as $order) { $p = intval($order['dingnum']) * $order['price']; $totalprice += $p; } } } $productname = getProductName($row['productautoid'], $row['typeid'], $row['productname']); //预订产品名称 $dingdate = Mydate('Y-m-d H:i:s', $row['addtime']); $status = getOrderStatus($row['status'], $row['paytype']); $orderurl = "index.php?dopost=vieworder&typeid={$row['typeid']}&orderid={$row['id']}"; $out .= ' <tr> <td height="50">' . $row['ordersn'] . '</td> <td>' . $productname . '</td> <td align="center">¥' . $totalprice . '</td> <td align="center">' . $dingdate . '</td> <td align="center">' . $status . '</td> <td align="center"><a class="ck_cz" href="' . $orderurl . '">查看</a></td> </tr>'; } $foot = ' </table>'; $out = !empty($out) ? $head . $out . $foot : $nocontent_msg; $totalnum = $_model->getCount("memberid='{$uid}' and pid=0 " . $w); $totalpage = ceil($totalnum / $pagesize); $pageinfo = setPageInfo($curpage, $totalpage);
case '0': $wait = ' <span class="label label-info">รอการตอบกลับจากบริษัท</span>'; break; case '1': $wait = ' <span class="label label-warning">รอการตอบกลับจากลูกค้า</span>'; $dataRes[] = '<tr class="' . getMemberOrderTr($row['status']) . '"> <td><a href="?page=orderDetail&orderid=' . $row['orderID'] . '">' . $row['orderID'] . '</td> <td>' . ($row['productID'] ? 'เลือกรูปแบบพื้นฐาน' : 'กำหนดเองโดยลูกค้า') . $wait . '</td> <td>' . getOrderStatus($row['status']) . '</td> </tr>'; break; } $tableData .= '<tr class="' . getMemberOrderTr($row['status']) . '"> <td><a href="?page=orderDetail&orderid=' . $row['orderID'] . '">' . $row['orderID'] . '</td> <td>' . ($row['productID'] ? 'เลือกรูปแบบพื้นฐาน' : 'กำหนดเองโดยลูกค้า') . $wait . '</td> <td>' . getOrderStatus($row['status']) . '</td> </tr>'; } if (sizeof($dataRes) <= 0) { $tableDataRes = '<tr><td colspan="3" class="text-center">ไม่พบคำสั่งซื้อที่รอการตอบกลับ</td></tr>'; } else { sort($dataRes); foreach ($dataRes as $val) { $tableDataRes .= $val; } } } else { if (!$objQuery) { $tableDataRes .= '<tr><td colspan="3" class="text-center danger"><strong>ข้อผิดพลาด!</strong> มีปัญหาในการเรียกข้อมูล โปรดติดต่อผู้ดูแลระบบ</td></tr>'; $tableData .= '<tr><td colspan="3" class="text-center danger"><strong>ข้อผิดพลาด!</strong> มีปัญหาในการเรียกข้อมูล โปรดติดต่อผู้ดูแลระบบ</td></tr>'; } else {
//子订单编号 $oid = $order['oid']; $order_is_exist = checkOrderIsExist($oid); //返回结果:true 不存在 , false 已存在 if (!$order_is_exist) { $errormess .= "订单:'{$oid}'已存在。\r\n"; $order_num++; $update_order_tid_sql = "update ec_salesorder set tid='" . $tid . "' where oid='" . $oid . "'"; $adb->query($update_order_tid_sql); continue; } // begin insert //订单状态 $orderstatus_tmp = $order['status']; //临时 $orderstatus = getOrderStatus($orderstatus_tmp); //taobao.logistics.orders.detail.get 物流信息 if (in_array($orderstatus, $success_trade_status)) { $wlinfo = getLogisticsOrderWlInfo($rooturl, $session, $appKey, $appSecret, $tid); if (!empty($wlinfo)) { //物流单号 $wl_no = $wlinfo['order_code']; //物流公司 $wl_company = $wlinfo['company_name']; } else { $errormess .= "物流信息获取失败。\r\n"; } } else { //物流单号 $wl_no = ''; //物流公司
//当前页面,用于左侧导航选中 //$pv->Fields['pagename'] = $pagename; $pv->SetTemplet(MEMBERTEMPLET . "order_list.htm"); $pv->Display(); exit; } /*----------------------------- //查看订单详细 ------------------------------*/ if ($dopost == 'vieworder') { $pagename = $dopost; Helper_Archive::loadModule('common'); $_model = new CommonModule('#@__member_order'); $orderinfo = $_model->getOne("id='{$orderid}'"); $orderinfo['orderstatus'] = strip_tags(getOrderStatus($orderinfo['status'], $orderinfo['paytype'])); //订单状态 $orderinfo['dingjin'] = $orderinfo['dingjin'] * $orderinfo['dingnum']; if ($orderinfo['typeid'] == 2) { $childOrder = M::getChildOrderInfo($orderinfo['id']); $totalprice = 0; $roomdinginfo = array(); foreach ($childOrder as $order) { $p = intval($order['dingnum']) * $order['price']; $totalprice += $p; $roomdinginfo[] = array('usedate' => $order['usedate'], 'dingnum' => $order['dingnum'], 'totalprice' => $p, 'singleprice' => $order['price']); } $orderinfo['totalprice'] = $totalprice; } else { $orderinfo['totalprice'] = $orderinfo['dingnum'] * $orderinfo['price'] + $orderinfo['childnum'] * $orderinfo['childprice'] + $orderinfo['oldnum'] * $orderinfo['oldprice']; //总价格
protected function paySuccess($out_trade_no, $trade_no, $total_fee) { $payment_notice = D("PaymentNotice"); $payment = $payment_notice->where("oid='{$out_trade_no}'")->find(); if ($payment['is_paid']) { if ($payment['notice_no'] == $trade_no) { //return; } else { //此款项为多余支付 需要处理,不写了。 } } else { //更新支付记录表支付状态 //如果订单不存在。。。 //金额校验。。。懒得写了 $data = array(); $data['notice_sn'] = $trade_no; $data['pay_time'] = time(); $data['is_paid'] = '1'; $data['id'] = $payment['id']; $payment_notice->save($data); } //更新订单的状态 $deal_order = D("DealOrder"); $detail_model = D("DealOrderDetail"); $order = $deal_order->where("id='{$out_trade_no}'")->find(); $order_status = getOrderStatus(); $data = array('id' => $order['id']); if ($order['stutus'] = $order_status['deal']) { $data['status'] = $order_status['paid']; $data['pay_time'] = time(); } //echo $order['id']; //更新购买数量 $detail = $detail_model->where("oid='{$order['id']}'")->select(); foreach ($detail as $value) { $this->updateDeal($value); //生成团购券 $deal_sort = C("GROUP_SORT"); $deal_model = M("Deal"); $deal = $deal_model->find($detail['did']); if ($deal['group_sort'] == $deal_sort['coupon']) { $coupon = $this->saveCoupon($value); } } $deal_order->save($data); return; }
echo $link . dateFormat($row["order_date"], "Y-m-d", "m/d/Y") . "</a>"; ?> </td> <td align="left"><?php echo $adminCurrency['currency_symbol']; ?> <?php echo $link . htmlentities(number_format($orderTotal, 2, ".", "")) . "</a>"; ?> </td> <td align="center"><?php echo $confirm_link; ?> </td> <td align="center"><?php echo $link . htmlentities(getOrderStatus($row["order_id"])) . "</a>"; ?> </td> </tr> <?php $i++; } } else { ?> <tr> <td align="center" valign="middle" colspan="8" class="text_information">No Records Found !!</td> </tr> <?php } if ($page > 1) { $pageprev = $page - 1;
//echo $rr['enable_rma']."==".$row['ngift_product_id']."==".getRefundOrderStatus($row["order_id"]) ?> <?php // echo "<br>enable_rma :".$rr['enable_rma']; echo "<br>".getRefundOrderStatus($row["order_id"])==1 ; echo "<br>".checkAllProductsRefunded($row["order_id"]); // if($rr['enable_rma']=='Y' && $row['ngift_product_id']=='' && getRefundOrderStatus($row["order_id"])==1) { if ($rr['enable_rma'] == 'Y' && getRefundOrderStatus($row["order_id"]) == 1 && !checkAllProductsRefunded($row["order_id"])) { if ($row["refundflag"] != '') { echo "Refund Request already sent"; } else { echo " <I><a href='refund_request.php?orderid=" . $row["order_id"] . "' class='required'> Request Refund </a><I>"; } } //echo "\n ##". htmlentities(getOrderStatus($row["order_id"]))."##".$row["refund_id"]; ?> <?php if ($rr['enable_rma'] == 'Y' && htmlentities(getOrderStatus($row["order_id"])) == "Delivered" && $row["refund_id"] != '0') { echo " ( Refund Requested )"; } ?> </td> </tr> <?php } } else { ?> <tr> <td colspan="7" class="text_information" align="center">No Results Found !!</td> </tr> <?php
//08.25.2015 ghh - added getinventory request RestLog("Getting Item Information"); require_once "getiteminfo.php"; getItemInfo($requestvars, $responsetype); break; case 'getmodel': //08.25.2015 ghh - added getinventory request RestLog("Getting Model Info"); require_once "getmodel.php"; getModel($requestvars, $responsetype); break; case 'getorderstatus': //08.25.2015 ghh - added getinventory request RestLog("Getting Order Status"); require_once "getorderstatus.php"; getOrderStatus($requestvars, $responsetype); break; default: die(RestUtils::sendResponse(400, 'Error 16542: Bad Request')); //Bad Request break; } break; //08.20.2015 ghh - send requests enter here //08.20.2015 ghh - send requests enter here case 'post': switch ($requesttype) { case 'sendorder': RestLog("Send Order Called"); require_once "sendorder.php"; sendOrder($requestvars, $responsetype);
} elseif ($_USER['admin']) { $data = 'admin'; } else { $data = '<div class="alert alert-danger"><strong>ข้อผิดพลาด!</strong> คุณไม่มีสิทธิ์ในการดูเนื้อหาในหน้านี้</div>'; $noPermisson = true; } if (!$noPermisson) { $strSQL = sprintf("\n\t\t\tSELECT\n\t\t\t\tdateTime,status\n\t\t\tFROM\n\t\t\t\t`orderlog`\n\t\t\tWHERE\n\t\t\t\torderID = '%s'\n\t\t\tORDER BY\n\t\t\t\tdateTime\n\t\t\tDESC\n\t\t", mysql_real_escape_string($orderID)); $objQuery = mysql_query($strSQL); if ($objQuery && mysql_num_rows($objQuery) >= 1) { $tableData = ''; while ($row = mysql_fetch_assoc($objQuery)) { if ($_USER['member']) { $tableData .= '<tr> <td class="col-sm-2 text-center">' . date('d/m/Y H:i:s', strtotime($row['dateTime'])) . '</td> <td class="col-sm-10">เปลี่ยนสถานะเป็น ' . getOrderStatus($row['status']) . '</td> </tr>'; } elseif ($_USER['admin']) { $tableData = '<tr><td>admin</td></tr>'; } } } else { $tableData = '<tr><td colspan="2" class="text-center danger">ข้อผิดพลาด!</strong> มีปัญหาในการเรียกข้อมูล โปรดติดต่อผู้ดูแลระบบ</td></tr>'; } } } else { if ($objQuery) { $data = '<div class="alert alert-danger"><strong>ข้อผิดพลาด!</strong> ไม่พบการสั่งซื้อหมายเลข ' . $orderID . '</div>'; } else { $data = '<div class="alert alert-danger"><strong>ข้อผิดพลาด!</strong> มีปัญหาในการเรียกข้อมูล โปรดติดต่อผู้ดูแลระบบ</div>'; }