function updateWechatMode($customerId, $mode) { pdoUpdate('wechat_mode_tbl', array('mode' => $mode), array('c_id' => $customerId)); }
$_SESSION['customer_remark'] = html(trim($_POST['remark'])); echo 'ok'; exit; } if (isset($_POST['submitReview'])) { $insert = array('c_id' => $_SESSION['customerId'], 'order_id' => $_POST['order_id'], 'g_id' => $_POST['g_id'], 'd_id' => $_POST['d_id'], 'score' => $_POST['score']); if (isset($_POST['review']) && $_POST['review'] != '') { $insert['review'] = html(trim($_POST['review'])); } $id = pdoInsert('review_tbl', $insert, 'ignore'); $v1q = pdoQuery('review_tbl', array('count(*) as num'), array('order_id' => $_POST['order_id']), null); $reviewed = $v1q->fetch(); $v2q = pdoQuery('user_input_review_view', array('count(*) as num'), array('order_id' => $_POST['order_id']), null); $unreview = $v2q->fetch(); if ($reviewed['num'] == $unreview['num']) { pdoUpdate('order_tbl', array('stu' => '3'), array('id' => $_POST['order_id'])); echo 'done'; exit; } echo $id; exit; } if (isset($_POST['linkKf'])) { include_once $GLOBALS['mypath'] . '/wechat/serveManager.php'; $response = linkKf($_SESSION['customerId']); echo $response; exit; } } //未登录 if (isset($_POST['getdetailprice'])) {
if ($_POST['trade_status'] == 'TRADE_FINISHED') { pdoUpdate('order_tbl', array('stu' => '1'), array('id' => $_GET['out_trade_no'])); //判断该笔订单是否在商户网站中已经做过处理 //如果没有做过处理,根据订单号(out_trade_no)在商户网站的订单系统中查到该笔订单的详细,并执行商户的业务程序 //请务必判断请求时的total_fee、seller_id与通知时获取的total_fee、seller_id为一致的 //如果有做过处理,不执行商户的业务程序 //注意: //退款日期超过可退款期限后(如三个月可退款),支付宝系统发送该交易状态通知 //调试用,写文本函数记录程序运行情况是否正常 //logResult("这里写入想要调试的代码变量值,或其他运行的结果记录"); } else { if ($_POST['trade_status'] == 'TRADE_SUCCESS') { // pdoUpdate('order_tbl',array('stu'=>'1'),array('id'=>$_GET['out_trade_no'])); include_once '../wechat/serveManager.php'; $orderId = $out_trade_no; pdoUpdate('order_tbl', array('stu' => "1"), array('id' => $orderId)); $query = pdoQuery('order_tbl', null, array('id' => $orderId), ' limit 1'); $inf = $query->fetch(); $payChkArray = array('first' => array('value' => '您在阿诗顿商城的网购订单已支付成功:'), 'orderno' => array('value' => $orderId, 'color' => '#0000ff'), 'amount' => array('value' => '¥' . $total_fee, 'color' => '#0000ff'), 'remark' => array('value' => '商城即将安排发货,请留意物流通知')); $re = sendTemplateMsg($inf['c_id'], $template_key_order, '', $payChkArray); //判断该笔订单是否在商户网站中已经做过处理 //如果没有做过处理,根据订单号(out_trade_no)在商户网站的订单系统中查到该笔订单的详细,并执行商户的业务程序 //请务必判断请求时的total_fee、seller_id与通知时获取的total_fee、seller_id为一致的 //如果有做过处理,不执行商户的业务程序 //注意: //付款完成后,支付宝系统发送该交易状态通知 //调试用,写文本函数记录程序运行情况是否正常 //logResult("这里写入想要调试的代码变量值,或其他运行的结果记录"); } } //——请根据您的业务逻辑来编写程序(以上代码仅作参考)——
<?php error_reporting(-1); ini_set('display_errors', 'On'); require 'vendor/autoload.php'; require 'time_since.php'; require 'db/aurasql.php'; require 'get_incidents.php'; $incidents = getIncidents(); foreach ($incidents as $incident) { $select = $query_factory->newSelect(); $select->cols(array('id', 'status'))->from('incidents')->where('incident_id = :incident_id')->bindValue('incident_id', $incident['incident_id'])->limit(1); $data = pdoSelect($select); if (count($data)) { $data = $data[0]; if ($incident['status'] !== $data['status']) { $update_data = array('status' => $incident['status'], 'duration' => $incident['duration']); if ($incident['status'] === 'resolved') { $update_data['resolved'] = $incident['resolved']; } d(pdoUpdate('incidents', $data['id'], $update_data)); } } else { d(pdoInsert('incidents', $incident)); } // d($data); }
exit; } if (isset($_POST['del_g_img'])) { $urlquery = pdoQuery('g_image_tbl', array('url'), array('g_id' => $_POST['g_id'], 'remark' => $_POST['md5']), 'limit 1'); $url = $urlquery->fetch(); pdoDelete('g_image_tbl', array('g_id' => $_POST['g_id'], 'remark' => $_POST['md5'])); $query = pdoQuery('g_image_tbl', array('id'), array('remark' => $_POST['md5']), ' limit 1'); if (!$query->fetch()) { unlink('../' . $url['url']); } echo 'ok'; exit; } if (isset($_POST['del_front_img'])) { $query = pdoQuery('ad_tbl', array('img_url'), array('id' => $_POST['id']), null); $row = $query->fetch(); pdoDelete('ad_tbl', array('id' => $_POST['id'])); unlink('../' . $row['img_url']); echo 'ok'; exit; } if (isset($_POST['change_part_stu'])) { pdoUpdate('part_tbl', array('dft_check' => $_POST['value']), array('id' => $_POST['id'])); echo $_POST['value']; exit; } if (isset($_POST['manageReview'])) { $id = pdoUpdate('review_tbl', array('priority' => $_POST['priority'], 'public' => $_POST['public']), array('id' => $_POST['id'])); echo $id; } }
if (isset($_GET['wechat'])) { include_once '../wechat/serveManager.php'; if (isset($_GET['createButton'])) { createButtonTemp(); exit; } if (isset($_GET['sendTemplateMsg'])) { // mylog($re); exit; } } if (isset($_GET['imgUpdate'])) { mylog('update'); } if (isset($_GET['goodsSituation'])) { pdoUpdate('g_inf_tbl', array('situation' => $_GET['goodsSituation']), array('id' => $_GET['g_id'])); $g_id = $_GET['g_id']; header('location:index.php?goods-config=1&g_id=' . $g_id); exit; } if (isset($_GET['updateParm'])) { $value['g_id'] = $_GET['g_id']; foreach ($_POST as $k => $v) { $value[$k] = $v; } pdoInsert('parameter_tbl', $value, 'update'); $g_id = $_GET['g_id']; header('location:index.php?goods-config=1&g_id=' . $g_id); exit; } }
echo $jsonInf; exit; } if (isset($_FILES['parts-img-up'])) { $uploader = new uploader('parts-img-up'); $uploader->upFile($_GET['g_id'] . '_' . time() . rand(1000, 9999)); $inf = $uploader->getFileInfo(); $jsonInf = json_encode($inf, JSON_UNESCAPED_UNICODE); if ('SUCCESS' == $inf['state']) { mylog('success'); $temp = pdoQuery('g_image_tbl', null, array('g_id' => $_GET['g_id']), 'limit 1'); if (!($row = $temp->fetch())) { pdoInsert('g_image_tbl', array('g_id' => $_GET['g_id'], 'url' => $inf['url'], 'remark' => $inf['md5']), 'ignore'); mylog("create record"); } else { pdoUpdate('g_image_tbl', array('remark' => $inf['md5'], 'url' => $inf['url']), array('g_id' => $_GET['g_id'])); $query = pdoQuery('image_view', null, array('remark' => $row['remark']), ' limit 1'); if (!($t = $query->fetch())) { unlink('../' . $row['url']); mylog('unlink"../' . $row['url']); } else { mylog('not unlink'); } } } mylog($jsonInf); echo $jsonInf; exit; } // if (isset($_GET['g_id'])){ //
} include 'view/order.html.php'; exit; } //地址页面修改已存在地址 if (isset($_GET['alterAddress'])) { $pro = getProvince($_POST['pro']); $city = getCity($_POST['pro'], $_POST['city']); $area = getArea($_POST['pro'], $_POST['city'], $_POST['area']); $value = array('pro_id' => $_POST['pro'], 'city_id' => $_POST['city'], 'area_id' => $_POST['area'], 'area' => $_POST['area'], 'province' => $pro, 'city' => $city, 'area' => $area, 'address' => $_POST['address'], 'name' => $_POST['name'], 'phone' => $_POST['phone']); if (-1 == $_POST['address_id']) { $value['c_id'] = $_SESSION['customerId']; $value['dft_a'] = 0; $addrId = pdoInsert('address_tbl', $value); } else { pdoUpdate('address_tbl', $value, array('id' => $_POST['address_id'])); } $from = isset($_GET['from']) ? '&from=' . $_GET['from'] : ''; header('location:controller.php?editAddress=1' . $from); } if (isset($_GET['editAddress'])) { $to = $_GET['from']; $addrQuery = pdoQuery('address_tbl', null, array('c_id' => $_SESSION['customerId']), ' limit 5'); $addrlist = array(); foreach ($addrQuery as $row) { $addrlist[] = $row; } include 'view/address.html.php'; exit; } if (isset($_GET['orderConfirm'])) {
//验证成功 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //请在这里加上商户的业务逻辑程序代码 //——请根据您的业务逻辑来编写程序(以下代码仅作参考)—— //获取支付宝的通知返回参数,可参考技术文档中页面跳转同步通知参数列表 //商户订单号 $out_trade_no = $_GET['out_trade_no']; //支付宝交易号 $trade_no = $_GET['trade_no']; //交易状态 $trade_status = $_GET['trade_status']; if ($_GET['trade_status'] == 'TRADE_FINISHED' || $_GET['trade_status'] == 'TRADE_SUCCESS') { //判断该笔订单是否在商户网站中已经做过处理 //如果没有做过处理,根据订单号(out_trade_no)在商户网站的订单系统中查到该笔订单的详细,并执行商户的业务程序 //如果有做过处理,不执行商户的业务程序 pdoUpdate('order_tbl', array('stu' => '9'), array('id' => $_GET['out_trade_no'])); } else { echo "trade_status=" . $_GET['trade_status']; } echo "验证成功<br />"; //——请根据您的业务逻辑来编写程序(以上代码仅作参考)—— ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// } else { //验证失败 //如要调试,请看alipay_notify.php页面的verifyReturn函数 echo "验证失败"; } ?> <title>支付宝手机网站支付接口</title> </head> <body>