<?php include '../config.php'; include '../webappClass/OrderClass.php'; $configobj = new config(); $conn = $configobj->getConnection(); $orderobj = new OrderClass(); $postdata = file_get_contents("php://input"); $request = json_decode($postdata); $user_id = $request->user_id; $order_id = $request->order_id; echo json_encode($orderobj->checkorAssignOrder($conn, $user_id, $order_id));
<?php include "common.inc.php"; InitGP(array("action", "type", "keyword", "aid", "page")); //初始化变量全局返回 include_once INC_PATH . "/order.class.php"; $orderobj = OrderClass::init(); $keyword = FilterSearch(stripslashes($keyword)); //过滤搜索 if ($keyword != '' || strlen($keyword) > 2) { $wherestr[] = "goodsname like '%" . $keyword . "%'"; } $type = GetNum($type); if ($type) { $wherestr[] = "typeid='" . $type . "'"; } //$wherestr[]="uname='".$_USERS['uname']."'"; if (!empty($wherestr)) { $wheresql = implode(' AND ', $wherestr); } //条件汇总 //获取当前页码 $total = $orderobj->getcount($wheresql); //总信息数 if ($total > 1000) { $total = 1000; } //显示最大一千条 $pagesize = 10; //一页显示信息数 $page = isset($page) ? max(1, intval($page)) : 1;
function carttoorder($id) { global $_USERS; if (!empty($id)) { $wherestr[] = $this->joinid($id); } $wherestr[] = "uname ='" . $_USERS['uname'] . "'"; if (empty($wherestr) || empty($_USERS['uname'])) { return false; } if (!empty($wherestr)) { $wheresql = implode(' AND ', $wherestr); } //条件汇总 //获取数据 $temparray = $this->getdata("", $wheresql); if (!empty($temparray)) { //进入用户操作类 include_once INC_PATH . "/member.class.php"; $m = new memberclass(); foreach ($temparray as $value) { $addarray = $value; $tempstate = $value['type'] == 1 ? 1 : 3; //带发直接状态修改成在途中 unset($addarray['gid']); //丢掉 unset($addarray['anonymous']); //丢掉 $addarray['addtime'] = time(); //添加时间 $addarray['state'] = $tempstate; //订单状态 //处理插入数据库 include_once INC_PATH . "/order.class.php"; $order = OrderClass::init(); $info = $order->add($addarray); if (GetNum($info)) { $seccessid[] = $info; //扣除用户帐户余额操作 if ($value['type'] != 2) { $tempmoney = $value['goodsprice'] * $value['goodsnum']; $note = lang('Buy') . "<a href=\\'" . $value['goodsurl'] . "\\' target=\\'_blank\\'>《" . $value['goodsname'] . "》</a> " . $value['goodsnum'] . lang('Pieces_order_ID') . $info; $m->moneyedit($_USERS['uname'], -$tempmoney, 1, $note); //扣去账户余额 } } else { $order->del($seccessid); //手动回滚操作 return lang('process_CartID') . $value['gid'] . lang('orderid_error'); } } //运费扣费处理 $result = $this->countmoney($temparray); //统计运费 foreach ($result['s'] as $key => $val) { $note = lang('goodsseller') . "[" . $key . "]" . lang('Domestic_Ship') . $val; $m->moneyedit($_USERS['uname'], -$val, 2, $note); //扣去账户余额 } $this->clear($id); //删除购物车商品 return 'OK'; } else { return '订单为空'; } }
//初始化变量全局返回 switch ($type) { case "new": $state = 0; $wherestr[] = "money_state='{$state}'"; break; case "payed": $wherestr[] = "money_state in(1,2)"; break; case "all": break; default: $state = 0; } include INC_PATH . "/order.class.php"; $o = new OrderClass(); if ($type == "clear" && !empty($oid)) { editstate("order", "state", "oid={$oid}", 2); //修改订单状态为取消 1完成 2作废 3退款给用户 showmessage(lang('Cancelorder_success'), $theurl, true); } $uname = $_USERS['uname']; $wherestr[] = "uname='{$uname}'"; if (!empty($wherestr)) { $wheresql = implode(' AND ', $wherestr); } //条件汇总 //获取当前页码 $total = $o->getcount($wheresql); //总信息数 $pagesize = 15;
<?php include '../config.php'; include '../webappClass/OrderClass.php'; $configobj = new config(); $conn = $configobj->getConnection(); $orderobj = new OrderClass(); $postdata = file_get_contents("php://input"); $request = json_decode($postdata); $order_id = $request->order_id; echo json_encode($orderobj->getSingleOrderDetail($conn, $order_id));
<?php @header("Content-Type:text/plain; charset=utf-8"); //弹出一键填单相关ajax数据处理 include "../common.inc.php"; InitGP(array("action", "url", "refuname", "referer", "aid", "cityid")); //初始化变量全局返回 AjaxHead(); $jsonarray = $dataarray = array(); if ($action == 'maqueeproduct') { include_once INC_PATH . "/order.class.php"; $o = OrderClass::init(); // $wherestr[]="uname='".$_USERS['uname']."'"; if (!empty($wherestr)) { $wheresql = implode(' AND ', $wherestr); } //条件汇总 $dataarray = $o->getdata(10, $wheresql, "oid desc", "*"); //获取数据 $jsonarray = array(); foreach ($dataarray as $key => $val) { $jsonarray[$key]['c'] = $val['typeid']; $jsonarray[$key]['d'] = ddate('m-d', $val['addtime']); $jsonarray[$key]['id'] = $val['oid']; $jsonarray[$key]['m'] = $val['goodsprice']; $jsonarray[$key]['n'] = $val['goodsname']; $jsonarray[$key]['p'] = $val['showimg']; $jsonarray[$key]['s'] = $val['goodssite']; $jsonarray[$key]['u'] = $val['goodsurl']; $jsonarray[$key]['un'] = substrs($val['uname'], 2, 1) . "***"; }
<?php include '../config.php'; include '../webappClass/OrderClass.php'; $configobj = new config(); $conn = $configobj->getConnection(); $orderobj = new OrderClass(); $postdata = file_get_contents("php://input"); $request = json_decode($postdata); $date = $request->date; $user_id = $request->user_id; echo json_encode($orderobj->getOrdersForEmployee($conn, $date, $user_id));
<?php include '../config.php'; include '../webappClass/OrderClass.php'; $configobj = new config(); $conn = $configobj->getConnection(); $orderobj = new OrderClass(); $postdata = file_get_contents("php://input"); $request = json_decode($postdata); $order_type = $request->order_type; $date = $request->date; echo json_encode($orderobj->getOrderByType($conn, $order_type, $date));
<?php include '../config.php'; include '../webappClass/OrderClass.php'; $configobj = new config(); $conn = $configobj->getConnection(); $orderobj = new OrderClass(); $postdata = file_get_contents("php://input"); $request = json_decode($postdata); $date = $request->date; echo json_encode($orderobj->getAllOrders($conn, $date));
<?php include "common.inc.php"; InitGP(array("action", "type", "oid", "sid", "page", "minPrice", "maxPrice", "pages", "goodprices", "addtime", "k", "c")); include_once INC_PATH . "/order.class.php"; $o = OrderClass::init(); $Table = new OrderClass(); $typeobj = new TableClass('otype', 'typeid'); if (empty($action)) { $k = FilterSearch(stripslashes($k)); //过滤搜索 if ($k != '' || strlen($k) > 2) { $wherestr[] = "goodsname like '%" . $k . "%'"; } $c = GetNum($c); if ($c) { $wherestr[] = "typeid='" . $c . "'"; } $wherestr[] = "state=1"; $wherestr[] = "type=1"; if (!empty($minPrice) && !empty($maxPrice)) { $wherestr[] = "goodsprice between {$minPrice} and {$maxPrice}"; } if (!empty($pages)) { $pagesize = $pages; } else { $pagesize = 9; } if (!empty($goodprices)) { if ($goodprices == asc) { $orderby = "goodsprice asc";
<?php include '../config.php'; include '../webappClass/OrderClass.php'; $configobj = new config(); $conn = $configobj->getConnection(); $orderobj = new OrderClass(); $postdata = file_get_contents("php://input"); $request = json_decode($postdata); $order_id = $request->order_id; $user_id = $request->user_id; $mobile_no = $request->mobile_no; $title = $request->title; $message = $request->message; echo json_encode($orderobj->insertPushMessage($conn, $user_id, $mobile_no, $order_id, $title, $message));
<?php include '../config.php'; include '../webappClass/OrderClass.php'; $configobj = new config(); $conn = $configobj->getConnection(); $orderobj = new OrderClass(); $postdata = file_get_contents("php://input"); $request = json_decode($postdata); $order_id = $request->order_id; $assign_to = $request->assign_to; echo json_encode($orderobj->allocOrderToEmployee($conn, $order_id, $assign_to));
/** * 对支付返回结果的处理 * */ private function modifyParment() { if (intval($this->_input['nc_order_serial']) == 0) { return false; } /*订单信息*/ $order_info = $this->obj_shop_order->getOrderInfo(array('order_serial' => "'" . trim($_GET['nc_order_serial']) . "'")); if (!$order_info) { $this->showMessage($this->_lang['shopping_order_error'], $this->_configinfo['websit']['site_url'], 1, 1000); } /*调出支付系统的相关内容*/ $pay_type = $this->obj_module_pay->getPayInfo(array('pay_id' => intval($this->_input['shopnccode']))); if (file_exists("api/payarea/" . $pay_type['pay_area_directory'] . "/" . $pay_type['pay_code'] . ".php")) { include_once "api/payarea/" . $pay_type['pay_area_directory'] . "/" . $pay_type['pay_code'] . ".php"; $pay_class_name = $pay_type['pay_code'] . 'PayClass'; $out_pay_type = new $pay_class_name(); $result = $out_pay_type->getParmentDo($order_info, $pay_type); } if (!$result) { include_once "order.class.php"; $goods_order = new OrderClass(); include_once 'goods.class.php'; $obj_goods = new GoodsClass(); include "system.class.php"; $email_template = new SystemClass(); include 'shopGoods.class.php'; $obj_shop_goods = new ShopGoodsClass(); include "shopsOrder.class.php"; $goods_shop_order = new ShopsOrderClass(); /*订单已确认*/ $goods_order->orderState(array('action_type' => 'conf_ok', 'order_state' => 1), $order_info['order_id']); /*订单已支付*/ $goods_order->orderState(array('action_type' => 'pay_ok', 'online_pay' => 1), $order_info['order_id']); /*以下为虚拟卡自动发货处理*/ $order_array = $goods_order->showGoodsOrder(array('detail_order_id' => $order_info['order_id'])); if (is_array($order_array)) { /*判断虚拟卡库存是否不足*/ $if_storage = true; foreach ($order_array as $k => $v) { /*如果虚拟卡库存足够,取出符合条件的虚拟卡信息*/ if ($v['goods_type'] == 2 && $v['is_send'] == '0') { /*虚拟卡库存*/ if ($this->_configinfo['websit']['pay_receive_type'] == 1) { //子店商品库存 $virtual_card_array = $this->obj_product->getProductInfo(array('goods_id' => $v['goods_id']), 'goods_storage'); $virtual_goods_storage = $virtual_card_array['goods_storage']; $sale_goods_id = $v['sale_goods_id']; } else { //主店商品库存 $shop_goods_array = $this->obj_product->getProductInfo(array('goods_id' => $v['goods_id']), 'shop_goods_id'); $virtual_goods_storage = $obj_shop_goods->getShopVirtualCardStorage($shop_goods_array['shop_goods_id']); $sale_goods_id = $shop_goods_array['shop_goods_id']; } if ($v['goods_count'] > $virtual_goods_storage) { /*库存不足*/ $if_storage = false; } else { /*取出本次要出售的虚拟卡*/ $virtual_card_array = array(); $condition = array(); $condition['goods_id'] = $sale_goods_id; $condition['is_sell'] = '0'; $virtual_card_array = $this->obj_virtual_card->getShopVirtualCardList($condition, '', array(), array(), '*', $v['goods_count']); /*更新虚拟卡状态*/ $condition_str = ''; foreach ($virtual_card_array as $vv) { $condition_str .= $vv['card_id'] . ','; } $condition_str = ' card_id in (' . trim($condition_str, ',') . ')'; $input_value = array(); $input_value['is_sell'] = '1'; $input_value['order_serial'] = trim($_GET['nc_order_serial']); $this->obj_virtual_card->updateVirtualCardState($input_value, $condition_str); /*更新订单虚拟卡商品发货状态*/ if ($this->_configinfo['websit']['pay_receive_type'] == 1) { $goods_order->updateOrderDetailState(array('is_send' => '1'), $v['order_detail_id']); } else { $goods_shop_order->updateOrderDetailState(array('is_send' => '1'), $v['order_detail_id']); } /*更新库存*/ if ($this->_configinfo['websit']['pay_receive_type'] == 1) { $obj_goods->modifyGoods(array('goods_storage' => 'goods_storage-' . $v['goods_count']), $sale_goods_id, 'formula'); } else { $obj_shop_goods->modifyGoods(array('goods_storage' => 'goods_storage-' . $v['goods_count']), $sale_goods_id, 'formula'); } /*邮件发货*/ if ($this->_configinfo['websit']['send_virtual_card_mail'] == '1') { $order_info['goods_name'] = $v['goods_name']; /*定义发货列表内容*/ $order_list_body = '<li>'; foreach ($virtual_card_array as $vv) { $order_list_body .= $this->_lang['shoping_virtual_card_number'] . $vv['card_number']; $order_list_body .= $this->_lang['shoping_virtual_card_password'] . $vv['password']; $order_list_body .= $this->_lang['shoping_virtual_card_end_time'] . $vv['end_time']; $order_list_body .= '</li>'; } $pay_email_template = $email_template->getEmailTemplate(array('mail_template_name' => "'send_virtual_card_mail'")); $pay_goods_array = array('user_name' => $order_info['receiver_name'], 'shop_name' => $this->_configinfo['websit']['site_name'], 'order_sn' => $order_info['order_serial'], 'goods_name' => $order_info['goods_name'], 'order_body' => $order_list_body, 'send_date' => date('Y-m-d', time())); $email_body = Common::replaceMailContent($pay_goods_array, $pay_email_template['mail_template_body']); /*发送邮件*/ Common::shopnc_send_mail($order_info['receiver_email'], $order_info['receiver_name'], $email_body); } } } } //如果订单只有虚拟卡,并且库存足够,即都已发货,更新订单状态为已发货 if ($order_info['order_type'] == 2 && $if_storage) { if ($this->_configinfo['websit']['pay_receive_type'] == 1) { $goods_order->orderState(array('action_type' => 'send_ok', 'order_state' => 1), $order_info['order_id']); } else { $goods_shop_order->orderState(array('action_type' => 'send_ok', 'order_state' => 1), $order_info['order_id']); } } } /*订单显示页面*/ /*订单产品*/ $order_goods = $goods_order->showGoodsOrder(array('detail_order_id' => $order_info['order_id'])); $this->output('order_goods', $order_goods); /*订单信息*/ $order_array = $goods_order->getOrderList(array('order_id' => $order_info['order_id']), ''); /*虚拟卡信息*/ if ($this->_configinfo['websit']['pay_receive_type'] == 1) { $virtual_card_array = $this->obj_virtual_card->getVirtualCardList(array('order_serial' => $order_array[0]['order_serial']), '', array('goods_id')); } else { $virtual_card_array = $this->obj_virtual_card->getShopVirtualCardList(array('order_serial' => $order_array[0]['order_serial']), '', array('goods_id')); } $this->output('virtual_card_array', $virtual_card_array); $this->getlang("user_center_my_order_view"); $order_state[1] = $this->_lang['my_order_be_confirmed']; //已确定 $order_state[0] = "<font color='red'>" . $this->_lang['my_order_unconfirmed'] . "</font>"; //未确定 $order_state1[1] = $this->_lang['my_order_have_paid']; //已付款 $order_state1[0] = "<font color='red'>" . $this->_lang['my_order_not_paid'] . "</font>"; //未付款 $order_state2[1] = $this->_lang['my_order_yes_send']; //已发货 $order_state2[0] = "<font color='red'>" . $this->_lang['my_order_no_send'] . "</font>"; //未发货 $order_state3[1] = $this->_lang['my_order_already_filled']; //已归档 $order_state3[0] = "<font color='red'>" . $this->_lang['my_order_no_fill'] . "</font>"; //为归档 $order_array[0]['order_state_txt'] = $order_state[$order_array[0]['order_state']]; $order_array[0]['order_state1_txt'] = $order_state1[$order_array[0]['order_state1']]; $order_array[0]['order_state2_txt'] = $order_state2[$order_array[0]['order_state2']]; $order_array[0]['order_state3_txt'] = $order_state3[$order_array[0]['order_state3']]; $this->output('order_array', $order_array[0]); $this->output('shopnc_pay_ok', '1'); $this->showpage('my_order_view'); /*发送邮件*/ if ($this->_configinfo['websit']['pay_mail'] == '1') { $pay_email_template = $email_template->getEmailTemplate(array('mail_template_name' => "'pay_mail'")); $pay_goods_array = array('user_name' => $order_array[0]['receiver_name'], 'shop_name' => $this->_configinfo['websit']['site_name'], 'order_sn' => $order_array[0]['order_serial']); $email_body = Common::replaceMailContent($pay_goods_array, $pay_email_template['mail_template_body']); /*发送邮件*/ Common::shopnc_send_mail($order_array[0]['receiver_email'], $order_array[0]['receiver_name'], $email_body); } } }
<?php include '../config.php'; include '../webappClass/OrderClass.php'; include '../webappClass/Constants.php'; $configobj = new config(); $con = $configobj->getConnection(); $orderobj = new OrderClass(); $target_path = "../uploads/"; $error = array(); $tmp = explode(".", $_FILES['file']['name']); $digits = 5; $rand = rand(pow(10, $digits - 1), pow(10, $digits) - 1); $newfilename = $rand . round(microtime(true)) . "." . end($tmp); $temp = $_FILES["file"]['tmp_name']; $target_path = $target_path . $newfilename; $insert_path = "/uploads/" . $newfilename; $order_id = $_POST["order_id"]; $user_id = $_POST["user_id"]; $order_type = $_POST["order_type"]; if (move_uploaded_file($temp, $target_path)) { echo json_encode($orderobj->generateInvoiceandUpdateOrder($con, $order_id, $filename, $insert_path, $user_id, $order_type)); } else { echo json_encode($_FILES['file']['error']); }
$mState = $_POST['m_status']; //支付状态2成功,3失败 $OrderInfo = $OrderMessage; //订单加密信息 $signMsg = $Digest; //密匙 //接收新的md5加密认证 $newmd5info = $newmd5info; $digest = strtoupper(md5($OrderInfo . $cfg_merpassword)); //本地的校对密钥 $newtext = $m_id . $m_orderid . $m_oamount . $cfg_merpassword . $mState; $myDigest = strtoupper(md5($newtext)); $mysign == md5($cfg_merchant . $buyid . $money . $success . $cfg_merpassword); //-------------------------------------------------------- //签名正确 if ($digest == $signMsg && $mState == 2) { $OrderInfo = HexToStr($OrderInfo); if ($newmd5info == $myDigest) { //支付成功处理更新数据库操作 include INC_PATH . "/order.class.php"; $o = new OrderClass(); $o->edit_money_state($buyid, 2, $m_oamount); showmsg("支付成功!", "../../m.php"); } else { showmsg("交易密钥错误,请与管理员联系!", "-1"); exit; } } else { showmsg("交易密钥错误,请与管理员联系!", "-1"); exit; }
<?php //我的劵 InitGP(array("action", "type", "oid", "sid", "page")); //初始化变量全局返回 include_once INC_PATH . "/order.class.php"; $o = OrderClass::init(); $Table = new OrderClass(); $datanum = $Table->getcount("uname='admin'"); AjaxHead(); if (empty($action)) { $uname = $_USERS['uname']; $wherestr[] = "uname='{$uname}'"; if ($type == 1) { $wherestr[] = "state=4"; } elseif ($type == 2) { $wherestr[] = "state =3"; } if (!empty($wherestr)) { $wheresql = implode(' AND ', $wherestr); } //条件汇总 $dataarray = $o->getdata("", $wheresql, ""); //获取团购数据 //订单分类 $dataarray123 = $dataarray4 = $dataarray5 = array(); if (is_array($dataarray)) { foreach ($dataarray as $val) { //if($val['state'] > 0 && $val['state'] < 4){ if ($val['state'] > 0 && $val['state'] <= 6 && $val['state'] != 5) { //已到仓库订单