Authored by xiaowei

记录log 登录注册支付

@@ -20,6 +20,7 @@ use Hood\Session; @@ -20,6 +20,7 @@ use Hood\Session;
20 use WebPlugin\Mobile; 20 use WebPlugin\Mobile;
21 use Api\Yohobuy; 21 use Api\Yohobuy;
22 use LibModels\Web\Passport\LoginData; 22 use LibModels\Web\Passport\LoginData;
  23 +use WebPlugin\UdpLog;
23 24
24 class WebAction extends Controller_Abstract 25 class WebAction extends Controller_Abstract
25 { 26 {
@@ -383,6 +384,7 @@ class WebAction extends Controller_Abstract @@ -383,6 +384,7 @@ class WebAction extends Controller_Abstract
383 $token = Helpers::makeToken($uid); 384 $token = Helpers::makeToken($uid);
384 $uidCookie = $userInfo['data']['profile_name'] . '::' . $userInfo['data']['uid'] . '::' . $userInfo['data']['vip_info']['title'] . '::' . $token; 385 $uidCookie = $userInfo['data']['profile_name'] . '::' . $userInfo['data']['uid'] . '::' . $userInfo['data']['vip_info']['title'] . '::' . $token;
385 $this->setCookie('_UID',$uidCookie,time() + 86400 * 360); 386 $this->setCookie('_UID',$uidCookie,time() + 86400 * 360);
  387 + UdpLog::info('【登录】同步登陆cookie生成',$uidCookie);
386 } 388 }
387 $this->setSession('_TOKEN', $token); 389 $this->setSession('_TOKEN', $token);
388 $this->setSession('_LOGIN_UID', $uid); 390 $this->setSession('_LOGIN_UID', $uid);
@@ -12,6 +12,8 @@ @@ -12,6 +12,8 @@
12 namespace Api; 12 namespace Api;
13 13
14 use Plugin\Cache; 14 use Plugin\Cache;
  15 +use WebPlugin\UdpLog;
  16 +
15 class Yohobuy 17 class Yohobuy
16 { 18 {
17 /* 正式环境 */ 19 /* 正式环境 */
@@ -190,6 +192,8 @@ class Yohobuy @@ -190,6 +192,8 @@ class Yohobuy
190 curl_setopt($ch, CURLOPT_USERAGENT, $userAgent); 192 curl_setopt($ch, CURLOPT_USERAGENT, $userAgent);
191 } 193 }
192 $result = curl_exec($ch); 194 $result = curl_exec($ch);
  195 + //log打印
  196 + UdpLog::info('get调用接口入参url/出参:', 'in:'.$url.' out:'.$result);
193 if (!$returnJson && !empty($result)) { 197 if (!$returnJson && !empty($result)) {
194 $result = json_decode($result, true); 198 $result = json_decode($result, true);
195 } 199 }
@@ -254,6 +258,8 @@ class Yohobuy @@ -254,6 +258,8 @@ class Yohobuy
254 curl_setopt($ch, CURLOPT_POSTFIELDS, $str); 258 curl_setopt($ch, CURLOPT_POSTFIELDS, $str);
255 } 259 }
256 $result = curl_exec($ch); 260 $result = curl_exec($ch);
  261 + //log打印
  262 + UdpLog::info('post调用接口入参url/出参:', 'in:'.$url.'?'.$str.' out:'.$result);
257 if (!$returnJson && !empty($result)) { 263 if (!$returnJson && !empty($result)) {
258 $result = json_decode($result, true); 264 $result = json_decode($result, true);
259 } 265 }
@@ -14,7 +14,7 @@ use WebPlugin\Pay\weixin\lib\WxPayConfig; @@ -14,7 +14,7 @@ use WebPlugin\Pay\weixin\lib\WxPayConfig;
14 use WebPlugin\Pay\weixin\lib\WxPayNativePay; 14 use WebPlugin\Pay\weixin\lib\WxPayNativePay;
15 use WebPlugin\Pay\weixin\lib\WxPayOrderQuery; 15 use WebPlugin\Pay\weixin\lib\WxPayOrderQuery;
16 use WebPlugin\Pay\weixin\lib\WxPayUnifiedOrder; 16 use WebPlugin\Pay\weixin\lib\WxPayUnifiedOrder;
17 -use WebPlugin\PhpLog; 17 +use WebPlugin\UdpLog;
18 18
19 /** 19 /**
20 * 支付有关方法 20 * 支付有关方法
@@ -26,18 +26,6 @@ use WebPlugin\PhpLog; @@ -26,18 +26,6 @@ use WebPlugin\PhpLog;
26 */ 26 */
27 class PayModel 27 class PayModel
28 { 28 {
29 - // 日志等级,2表示记录信息等级的日志  
30 - const LOG_LEVEL = 2;  
31 - // 支付方式有关接口调用日志  
32 - const PAYMENT_LIST_LOG = '/Data/logs/pc_pay/payment_list';  
33 - // 向ERP提交订单状态有关接口调用日志和更新订单状态有关接口调用日志  
34 - const ORDER_STATUS_LOG = '/Data/logs/pc_pay/order_status';  
35 - // 获取或者更新订单支付银行的接口调用日志  
36 - const ORDER_BANK_LOG = '/Data/logs/pc_pay/order_bank';  
37 - // 根据用户UID获取订单数有关接口调用日志  
38 - const ORDER_COUNT_LOG = '/Data/logs/pc_pay/order_count';  
39 - // 发送短信有关接口调用日志  
40 - const SEND_MESSAGE_LOG = '/Data/logs/pc_pay/send_message';  
41 29
42 // 是否老用户订单数判断值 30 // 是否老用户订单数判断值
43 const OLD_USER_LIMIT = 1; 31 const OLD_USER_LIMIT = 1;
@@ -86,8 +74,8 @@ class PayModel @@ -86,8 +74,8 @@ class PayModel
86 break; 74 break;
87 } 75 }
88 76
89 - $result['deliveryType'] =isset($order['delivery_time']) ? $order['delivery_time'] : '';  
90 - 77 + $result['deliveryType'] = isset($order['delivery_time']) ? $order['delivery_time'] : '';
  78 +
91 //统计成交的skn 79 //统计成交的skn
92 $sknList = array(); 80 $sknList = array();
93 $skuList = array(); 81 $skuList = array();
@@ -111,13 +99,7 @@ class PayModel @@ -111,13 +99,7 @@ class PayModel
111 // 用户ID 99 // 用户ID
112 $result['uid'] = $uid; 100 $result['uid'] = $uid;
113 101
114 - // 初始化日志  
115 - $log = new PhpLog(self::PAYMENT_LIST_LOG, 'PRC', self::LOG_LEVEL);  
116 - // 获取支付途径列表  
117 - $log->LogInfo('===开始调用支付方式列表接口,接口方法为web.SpaceOrders.getPaymentList===');  
118 $payTypes = PayData::getPaymentList(); 102 $payTypes = PayData::getPaymentList();
119 - $log->LogInfo('===结束调用支付方式列表接口,返回结果为===');  
120 - $log->LogInfo(var_export($payTypes, true));  
121 103
122 $defaultPayType = 0; 104 $defaultPayType = 0;
123 $types = array(); 105 $types = array();
@@ -148,45 +130,23 @@ class PayModel @@ -148,45 +130,23 @@ class PayModel
148 130
149 // 无需付款 131 // 无需付款
150 if (isset($order["payment_amount"]) && $order["payment_amount"] == 0) { 132 if (isset($order["payment_amount"]) && $order["payment_amount"] == 0) {
151 - // 初始化日志  
152 - $log = new PhpLog(self::ORDER_STATUS_LOG, 'PRC', self::LOG_LEVEL);  
153 - $log->LogInfo('===[' . $orderCode . ']===');  
154 -  
155 - // ERP提交订单状态  
156 - $log->LogInfo('===开始调用ERP提交订单状态接口,接口方法为web.SpaceOrders.submitOrderStatus===');  
157 - $log->LogInfo('===请求参数为orderCode=' . $orderCode . '===');  
158 - $erpReturn = PayData::submitOrderStatus($orderCode, 0, '', '', 0, '', '', '');  
159 - $log->LogInfo('===结束调用ERP提交订单状态接口,返回结果为===');  
160 - $log->LogInfo(var_export($erpReturn, true));  
161 -  
162 - // 更新订单的状态  
163 - $log->LogInfo('===开始调用更新订单状态接口,接口方法为web.SpaceOrders.updatePaymentStatus===');  
164 - $log->LogInfo('===请求参数为orderId=' . $order['order_id'] . 'uid=' . $uid . '===');  
165 - $updateOrderStatus = PayData::updateOrderStatus($order['order_id'], $uid, 0, 'Y', '');  
166 - $log->LogInfo('===结束调用更新订单状态接口,返回结果为===');  
167 - $log->LogInfo(var_export($updateOrderStatus, true));  
168 - 133 + PayData::submitOrderStatus($orderCode, 0, '', '', 0, '', '', '');
  134 + PayData::updateOrderStatus($order['order_id'], $uid, 0, 'Y', '');
169 $result['notNeedPay'] = true; 135 $result['notNeedPay'] = true;
170 break; 136 break;
171 } 137 }
172 138
173 - // 记录支付方式  
174 - // 初始化日志  
175 - $log = new PhpLog(self::ORDER_BANK_LOG, 'PRC', self::LOG_LEVEL);  
176 - $log->LogInfo('===开始调用记录支付方式接口,接口方法为web.SpaceOrders.getOrderPayBank===');  
177 - $log->LogInfo('===请求参数为orderCode=' . $orderCode . '===');  
178 $bankRecord = PayData::getBankByOrder($orderCode); 139 $bankRecord = PayData::getBankByOrder($orderCode);
179 - $log->LogInfo('===结束调用记录支付方式接口,返回结果为===');  
180 - $log->LogInfo(var_export($bankRecord, true));  
181 140
182 if (isset($bankRecord['data']['bankCode']) && !empty($bankRecord['data']['bankCode'])) { 141 if (isset($bankRecord['data']['bankCode']) && !empty($bankRecord['data']['bankCode'])) {
183 $payRecord = $bankRecord['data']['bankCode']; 142 $payRecord = $bankRecord['data']['bankCode'];
184 - } else {  
185 - $payCode = $order['payment'] ?: $defaultPayType; 143 + }
  144 + else {
  145 + $payCode = $order['payment'] ? : $defaultPayType;
186 //记录app上的支付方式 146 //记录app上的支付方式
187 $changeCodes = array( 147 $changeCodes = array(
188 - 19 => 21,// app上微信支付  
189 - 22 => 21,// h5微信支付 148 + 19 => 21, // app上微信支付
  149 + 22 => 21, // h5微信支付
190 18 => $defaultPayType// h5支付宝支付 150 18 => $defaultPayType// h5支付宝支付
191 ); 151 );
192 $platformCode = isset($changeCodes[$payCode]) && $changeCodes[$payCode] ? $changeCodes[$payCode] : $payCode; 152 $platformCode = isset($changeCodes[$payCode]) && $changeCodes[$payCode] ? $changeCodes[$payCode] : $payCode;
@@ -202,12 +162,7 @@ class PayModel @@ -202,12 +162,7 @@ class PayModel
202 162
203 // 是否是老用户(用于订单统计) 163 // 是否是老用户(用于订单统计)
204 $orderCount = 0; 164 $orderCount = 0;
205 - // 初始化日志  
206 - $log = new PhpLog(self::ORDER_COUNT_LOG, 'PRC', self::LOG_LEVEL);  
207 - $log->LogInfo('===开始调用查询用户订单数接口,接口方法为web.SpaceOrders.getOrderCountByUid===');  
208 $orders = PayData::getOrderCountByUid($uid); 165 $orders = PayData::getOrderCountByUid($uid);
209 - $log->LogInfo('===结束调用查询用户订单数接口,返回结果为===');  
210 - $log->LogInfo(var_export($orders, true));  
211 166
212 if (isset($orders['data']) && !empty($orders['data'])) { 167 if (isset($orders['data']) && !empty($orders['data'])) {
213 $orderCount = $orders['data']['total']; 168 $orderCount = $orders['data']['total'];
@@ -220,8 +175,8 @@ class PayModel @@ -220,8 +175,8 @@ class PayModel
220 $result['orderGoods'] = $order['order_goods']; 175 $result['orderGoods'] = $order['order_goods'];
221 // 订单商品数(用于订单统计) 176 // 订单商品数(用于订单统计)
222 $result['ordersGoodsNums'] = count($order['order_goods']); 177 $result['ordersGoodsNums'] = count($order['order_goods']);
223 -  
224 - } while (false); 178 + }
  179 + while (false);
225 180
226 return $result; 181 return $result;
227 } 182 }
@@ -253,7 +208,6 @@ class PayModel @@ -253,7 +208,6 @@ class PayModel
253 return $result; 208 return $result;
254 } 209 }
255 210
256 -  
257 /** 211 /**
258 * 获取支付有关信息 212 * 获取支付有关信息
259 * 213 *
@@ -344,7 +298,8 @@ class PayModel @@ -344,7 +298,8 @@ class PayModel
344 $bankCode = ($paymentParameter != 'platform' ? $paymentParameter : ''); 298 $bankCode = ($paymentParameter != 'platform' ? $paymentParameter : '');
345 if (isset($bankRecord['data']['bankCode']) && !empty($bankRecord['data']['bankCode'])) { 299 if (isset($bankRecord['data']['bankCode']) && !empty($bankRecord['data']['bankCode'])) {
346 $bankPayRecord = PayData::updateOrderPayBank($orderCode, $payId, $bankCode); 300 $bankPayRecord = PayData::updateOrderPayBank($orderCode, $payId, $bankCode);
347 - } else { 301 + }
  302 + else {
348 $bankPayRecord = PayData::setOrderPayBank($orderCode, $payId, $bankCode); 303 $bankPayRecord = PayData::setOrderPayBank($orderCode, $payId, $bankCode);
349 } 304 }
350 if (!isset($bankPayRecord['code']) || $bankPayRecord['code'] != 200) { 305 if (!isset($bankPayRecord['code']) || $bankPayRecord['code'] != 200) {
@@ -357,11 +312,13 @@ class PayModel @@ -357,11 +312,13 @@ class PayModel
357 //直接跳转到支付界面 312 //直接跳转到支付界面
358 $result['go'] = true; 313 $result['go'] = true;
359 $result['payUrl'] = $reqPars['pay_url'] . '?' . $reqPars['pars']; 314 $result['payUrl'] = $reqPars['pay_url'] . '?' . $reqPars['pars'];
360 - } else { 315 + }
  316 + else {
361 //如果是post,去form提交 317 //如果是post,去form提交
362 $result = array('reqPars' => $reqPars); 318 $result = array('reqPars' => $reqPars);
363 } 319 }
364 - } while (false); 320 + }
  321 + while (false);
365 322
366 return $result; 323 return $result;
367 } 324 }
@@ -388,7 +345,6 @@ class PayModel @@ -388,7 +345,6 @@ class PayModel
388 return $result; 345 return $result;
389 } 346 }
390 347
391 -  
392 /** 348 /**
393 * 处理微信支付 349 * 处理微信支付
394 * 350 *
@@ -402,11 +358,10 @@ class PayModel @@ -402,11 +358,10 @@ class PayModel
402 358
403 do { 359 do {
404 // 初始化日志 360 // 初始化日志
405 - $log = new PhpLog(self::ORDER_STATUS_LOG, 'PRC', self::LOG_LEVEL);  
406 - $log->LogInfo('=====[' . $orderCode . ']===开始生成微信支付二维码========'); 361 + UdpLog::info('【支付】开始生成微信支付二维码', 'orderCode:' . $orderCode);
407 362
408 if (empty($orderCode)) { 363 if (empty($orderCode)) {
409 - $log->LogInfo('=====[' . $orderCode . ']===微信支付时,订单号为空========'); 364 + UdpLog::info('【支付】微信支付时,订单号为空', 'orderCode:' . $orderCode);
410 $result['error'] = true; 365 $result['error'] = true;
411 $result['message'] = '订单号不能为空'; 366 $result['message'] = '订单号不能为空';
412 break; 367 break;
@@ -415,19 +370,19 @@ class PayModel @@ -415,19 +370,19 @@ class PayModel
415 /* 判断订单信息是否存在 */ 370 /* 判断订单信息是否存在 */
416 $orderDetail = OrderData::getOrderDetail($uid, $orderCode); 371 $orderDetail = OrderData::getOrderDetail($uid, $orderCode);
417 if (!isset($orderDetail['data']) || empty($orderDetail['data'])) { 372 if (!isset($orderDetail['data']) || empty($orderDetail['data'])) {
418 - $log->LogInfo('=====[' . $orderCode . ']===微信支付时,订单信息未查到========'); 373 + UdpLog::info('【支付】微信支付时,订单信息未查到', 'orderInfo:' . json_encode($orderDetail));
419 $result['error'] = true; 374 $result['error'] = true;
420 $result['message'] = '没有找到该订单'; 375 $result['message'] = '没有找到该订单';
421 break; 376 break;
422 } 377 }
423 378
424 - /*$wechatqrcode = new Service(array('id' => $paymentCode));  
425 - $reqPars = $wechatqrcode->pay(array('order_code'=>$orderCode));  
426 - if (empty($reqPars)) {  
427 - $result['error'] = true;  
428 - $result['message'] = '支付系统繁忙,请稍后再试';  
429 - break;  
430 - }*/ 379 + /* $wechatqrcode = new Service(array('id' => $paymentCode));
  380 + $reqPars = $wechatqrcode->pay(array('order_code'=>$orderCode));
  381 + if (empty($reqPars)) {
  382 + $result['error'] = true;
  383 + $result['message'] = '支付系统繁忙,请稍后再试';
  384 + break;
  385 + } */
431 386
432 //统一下单 387 //统一下单
433 $totalFee = strval($orderDetail['data']['payment_amount'] * 100); 388 $totalFee = strval($orderDetail['data']['payment_amount'] * 100);
@@ -442,8 +397,7 @@ class PayModel @@ -442,8 +397,7 @@ class PayModel
442 $input->SetProduct_id($orderCode); 397 $input->SetProduct_id($orderCode);
443 $notify = new WxPayNativePay(); 398 $notify = new WxPayNativePay();
444 $payResult = $notify->GetPayUrl($input); 399 $payResult = $notify->GetPayUrl($input);
445 - $log->LogInfo('=====[' . $orderCode . ']===微信支付时,微信统一下单的返回结果为:========');  
446 - $log->LogInfo(var_export($payResult, true)); 400 + UdpLog::info('【支付】微信支付时,微信统一下单的返回结果为', 'orderCode:' . $orderCode . 'result:' . var_export($payResult, true));
447 401
448 $orderData = $orderDetail['data']; 402 $orderData = $orderDetail['data'];
449 $firstGoods = current($orderData['order_goods']); 403 $firstGoods = current($orderData['order_goods']);
@@ -457,10 +411,9 @@ class PayModel @@ -457,10 +411,9 @@ class PayModel
457 'choosePayUrl' => Helpers::url('/shopping/pay', array('order_code' => $orderData['order_code'])), 411 'choosePayUrl' => Helpers::url('/shopping/pay', array('order_code' => $orderData['order_code'])),
458 'qrcodeUrl' => $payResult['code_url'] // 'http://paysdk.weixin.qq.com/example/qrcode.php?data=' . $result['code_url'] 412 'qrcodeUrl' => $payResult['code_url'] // 'http://paysdk.weixin.qq.com/example/qrcode.php?data=' . $result['code_url']
459 ); 413 );
460 -  
461 - } while (false);  
462 - $log->LogInfo('=====[' . $orderCode . ']===微信支付时,处理微信支付的结果为:========');  
463 - $log->LogInfo(var_export($result, true)); 414 + }
  415 + while (false);
  416 + UdpLog::info('【支付】微信支付结果', var_export($result, true));
464 417
465 return $result; 418 return $result;
466 } 419 }
@@ -485,26 +438,26 @@ class PayModel @@ -485,26 +438,26 @@ class PayModel
485 } 438 }
486 439
487 // 初始化日志 440 // 初始化日志
488 - $log = new PhpLog(self::ORDER_STATUS_LOG, 'PRC', self::LOG_LEVEL);  
489 - $log->LogInfo('=====[' . $orderCode . ']===开始查询微信扫码支付状态========'); 441 + UdpLog::info('【支付】开始查询微信扫码支付状态', 'orderCode:' . $orderCode);
490 442
491 // 组装微信支付的订单号 443 // 组装微信支付的订单号
492 $tradeNo = 'YOHOBuy_' . $orderCode; 444 $tradeNo = 'YOHOBuy_' . $orderCode;
493 $input = new WxPayOrderQuery(); 445 $input = new WxPayOrderQuery();
494 $input->SetOut_trade_no($tradeNo); 446 $input->SetOut_trade_no($tradeNo);
495 $payResult = WxPayApi::orderQuery($input); 447 $payResult = WxPayApi::orderQuery($input);
496 - $log->LogInfo(var_export($payResult, true)); 448 + UdpLog::info('【支付】微信扫码支付返回', 'payResult:' . var_export($payResult, true));
497 449
498 if (isset($payResult['trade_state']) && $payResult['trade_state'] === 'SUCCESS') { 450 if (isset($payResult['trade_state']) && $payResult['trade_state'] === 'SUCCESS') {
499 - $log->LogInfo('====[' . $orderCode . ']====微信扫码支付成功========'); 451 + UdpLog::info('【支付】微信扫码支付成功');
500 $result = array( 452 $result = array(
501 'code' => '200', 453 'code' => '200',
502 'message' => 'success' 454 'message' => 'success'
503 ); 455 );
504 } 456 }
505 457
506 - $log->LogInfo('====[' . $orderCode . ']====微信扫码支付失败========');  
507 - } while (false); 458 + UdpLog::info('【支付】微信扫码支付失败');
  459 + }
  460 + while (false);
508 461
509 return $result; 462 return $result;
510 } 463 }
@@ -526,17 +479,12 @@ class PayModel @@ -526,17 +479,12 @@ class PayModel
526 479
527 do { 480 do {
528 // 初始化日志 481 // 初始化日志
529 - $log = new PhpLog(self::ORDER_STATUS_LOG, 'PRC', self::LOG_LEVEL);  
530 - $log->LogInfo('========[' . $payResult->orderCode . ']========');  
531 - $log->LogInfo(var_export($payResult, true)); 482 + UdpLog::info('【支付】订单支付后续处理','orderCode:'.$payResult->orderCode.'payResult:'.var_export($payResult, true));
532 483
533 - $log->LogInfo('==[' . $payResult->orderCode . ']=开始调用获取订单详情方式接口,接口方法为app.SpaceOrders.detail===');  
534 $orderInfo = OrderData::getOrderDetail($uid, $payResult->orderCode); 484 $orderInfo = OrderData::getOrderDetail($uid, $payResult->orderCode);
535 - $log->LogInfo('==[' . $payResult->orderCode . ']=结束调用获取订单详情方式接口,返回结果为===');  
536 - $log->LogInfo(var_export($orderInfo, true));  
537 485
538 if (!isset($orderInfo['data']) || empty($orderInfo['data'])) { 486 if (!isset($orderInfo['data']) || empty($orderInfo['data'])) {
539 - $log->LogInfo('==[' . $payResult->orderCode . ']=订单支付失败,未获取到订单详情信息==='); 487 + UdpLog::info('【支付】订单支付后续处理,未查询到订单信息','orderCode:'.$payResult->orderCode);
540 break; 488 break;
541 } 489 }
542 490
@@ -549,12 +497,7 @@ class PayModel @@ -549,12 +497,7 @@ class PayModel
549 if ($orderData['is_cancel'] === 'Y' && $paymentStatus === 'N') { 497 if ($orderData['is_cancel'] === 'Y' && $paymentStatus === 'N') {
550 // 给用户发送短信 498 // 给用户发送短信
551 // 初始化日志 499 // 初始化日志
552 - $log = new PhpLog(self::SEND_MESSAGE_LOG, 'PRC', self::LOG_LEVEL);  
553 - $log->LogInfo('===[' . $orderCode . ']===');  
554 - $log->LogInfo('==[' . $orderCode . ']=开始调用订单取消时给用户发短信接口,接口方法为app.message.sendMsg===');  
555 - $messageReturn = PayData::sendMessage($orderData['mobile'], 'error_sms', '支付成功,但订单已取消,订单号为' . $orderCode);  
556 - $log->LogInfo('==[' . $orderCode . ']=结束调用给用户发短信接口,返回结果为===');  
557 - $log->LogInfo(var_export($messageReturn, true)); 500 + PayData::sendMessage($orderData['mobile'], 'error_sms', '支付成功,但订单已取消,订单号为' . $orderCode);
558 501
559 $result['code'] = 417; 502 $result['code'] = 417;
560 $result['message'] = '支付成功,但订单已取消,需联系客服'; 503 $result['message'] = '支付成功,但订单已取消,需联系客服';
@@ -563,8 +506,7 @@ class PayModel @@ -563,8 +506,7 @@ class PayModel
563 506
564 // 支付金额与订单金额不一致 507 // 支付金额与订单金额不一致
565 if (round($amount, 2) != round($payResult->totalFee, 2)) { 508 if (round($amount, 2) != round($payResult->totalFee, 2)) {
566 - $log = new PhpLog(self::ORDER_STATUS_LOG, 'PRC', self::LOG_LEVEL);  
567 - $log->LogInfo('==[' . $orderCode . ']=订单支付失败,支付金额与订单金额不一致==='); 509 + UdpLog::info('【支付】订单支付后续处理,订单支付金额不一致','orderCode:'.$orderCode.'account:'.round($amount, 2).'payfee:'.round($payResult->totalFee, 2));
568 $result['code'] = 415; 510 $result['code'] = 415;
569 $result['message'] = '支付金额与订单金额不一致'; 511 $result['message'] = '支付金额与订单金额不一致';
570 break; 512 break;
@@ -577,24 +519,11 @@ class PayModel @@ -577,24 +519,11 @@ class PayModel
577 $bankName = $payResult->bankName; 519 $bankName = $payResult->bankName;
578 $bankCode = $payResult->bankCode; 520 $bankCode = $payResult->bankCode;
579 521
580 - // 初始化日志  
581 - $log = new PhpLog(self::ORDER_STATUS_LOG, 'PRC', self::LOG_LEVEL);  
582 - $log->LogInfo('===[' . $orderCode . ']===');  
583 -  
584 - $log->LogInfo('==[' . $orderCode . ']=开始调用ERP提交订单状态接口,接口方法为web.SpaceOrders.submitOrderStatus===');  
585 - $log->LogInfo('==[' . $orderCode . ']=请求参数为orderCode=' . $orderCode . '===');  
586 // ERP提交订单状态 522 // ERP提交订单状态
587 - $erpReturn = PayData::submitOrderStatus($orderCode, $payment, $bankName, $bankCode, $amount, $payOrderCode, $tradeNo, $bankBillNo);  
588 - $log->LogInfo('==[' . $orderCode . ']=结束调用ERP提交订单状态接口,返回结果为===');  
589 - $log->LogInfo(var_export($erpReturn, true)); 523 + PayData::submitOrderStatus($orderCode, $payment, $bankName, $bankCode, $amount, $payOrderCode, $tradeNo, $bankBillNo);
590 524
591 - $log->LogInfo('==[' . $orderCode . ']=开始调用更新订单状态接口,接口方法为web.SpaceOrders.updatePaymentStatus===');  
592 - $log->LogInfo('==[' . $orderCode . ']=请求参数为orderId=' . $orderData['order_id'] . 'uid=' . $uid . '===');  
593 // 更新订单的状态 525 // 更新订单的状态
594 $updateOrderStatus = PayData::updateOrderStatus($orderData['order_id'], $uid, $payment, 'Y', $bankCode); 526 $updateOrderStatus = PayData::updateOrderStatus($orderData['order_id'], $uid, $payment, 'Y', $bankCode);
595 - $log->LogInfo('==[' . $orderCode . ']=结束调用更新订单状态接口,返回结果为===');  
596 - $log->LogInfo(var_export($updateOrderStatus, true));  
597 - $log->LogInfo('==[' . $orderCode . ']=订单支付成功,请等待发货===');  
598 527
599 $result['code'] = 200; 528 $result['code'] = 200;
600 $result['message'] = '支付成功,请等待发货'; 529 $result['message'] = '支付成功,请等待发货';
@@ -611,8 +540,10 @@ class PayModel @@ -611,8 +540,10 @@ class PayModel
611 'vipUrl' => Helpers::url('/help', array('category_id' => 91)), 540 'vipUrl' => Helpers::url('/help', array('category_id' => 91)),
612 'returnHomeUrl' => Helpers::url('/') 541 'returnHomeUrl' => Helpers::url('/')
613 ); 542 );
614 - } while (false); 543 + }
  544 + while (false);
615 545
616 return $result; 546 return $result;
617 } 547 }
618 -}  
  548 +
  549 +}
@@ -7,6 +7,7 @@ use Passport\PassportModel; @@ -7,6 +7,7 @@ use Passport\PassportModel;
7 use Configs\ChannelConfig; 7 use Configs\ChannelConfig;
8 use WebPlugin\Helpers; 8 use WebPlugin\Helpers;
9 use WebPlugin\Cache; 9 use WebPlugin\Cache;
  10 +use WebPlugin\UdpLog;
10 11
11 /** 12 /**
12 * 登录 13 * 登录
@@ -113,6 +114,7 @@ class LoginController extends WebAction @@ -113,6 +114,7 @@ class LoginController extends WebAction
113 $verifyCode = trim($this->post('captcha')); 114 $verifyCode = trim($this->post('captcha'));
114 $isRemember = $this->post('isRemember'); 115 $isRemember = $this->post('isRemember');
115 if (!is_numeric($area) || empty($account) || empty($password)) { 116 if (!is_numeric($area) || empty($account) || empty($password)) {
  117 + UdpLog::info('【登录】校验参数传递auth','area:'.$area.'account:'.$account.'password:'.$password);
116 break; 118 break;
117 } 119 }
118 120
@@ -120,6 +122,7 @@ class LoginController extends WebAction @@ -120,6 +122,7 @@ class LoginController extends WebAction
120 $verifyEmail = Helpers::verifyEmail($account); 122 $verifyEmail = Helpers::verifyEmail($account);
121 $verifyMobile = Helpers::verifyAreaMobile(Helpers::makeMobile($area, $account)); 123 $verifyMobile = Helpers::verifyAreaMobile(Helpers::makeMobile($area, $account));
122 if (!$verifyEmail && !$verifyMobile) { 124 if (!$verifyEmail && !$verifyMobile) {
  125 + UdpLog::info('【登录】校验账号是否有效auth','email:'.$verifyEmail.'mobile:'.$verifyMobile);
123 break; 126 break;
124 } 127 }
125 128
@@ -161,6 +164,7 @@ class LoginController extends WebAction @@ -161,6 +164,7 @@ class LoginController extends WebAction
161 if ($verifyCode) { 164 if ($verifyCode) {
162 $picFlag = PassportModel::verifyCode($verifyCode); 165 $picFlag = PassportModel::verifyCode($verifyCode);
163 if (!$picFlag) { 166 if (!$picFlag) {
  167 + UdpLog::info('【登录】登录验证码','area:'.$area.'account:'.$account.'verifyCode:'.$verifyCode);
164 $data = array('code' => 400, 'message' => '验证码不正确或验证码已过期', 'data' => array('needCaptcha' => true, 'errorType' => 'captcha')); 168 $data = array('code' => 400, 'message' => '验证码不正确或验证码已过期', 'data' => array('needCaptcha' => true, 'errorType' => 'captcha'));
165 break; 169 break;
166 } 170 }
@@ -6,6 +6,7 @@ use WebPlugin\Helpers; @@ -6,6 +6,7 @@ use WebPlugin\Helpers;
6 use WebPlugin\Cache; 6 use WebPlugin\Cache;
7 use Passport\PassportModel; 7 use Passport\PassportModel;
8 use LibModels\Web\Passport\BindData; 8 use LibModels\Web\Passport\BindData;
  9 +use WebPlugin\UdpLog;
9 10
10 /** 11 /**
11 * 注册 12 * 注册
@@ -265,6 +266,7 @@ class RegisterController extends WebAction @@ -265,6 +266,7 @@ class RegisterController extends WebAction
265 $mobile = trim($this->post('mobile')); 266 $mobile = trim($this->post('mobile'));
266 $area = trim($this->post('area')); 267 $area = trim($this->post('area'));
267 if (!is_numeric($mobile) || !is_numeric($area)) { 268 if (!is_numeric($mobile) || !is_numeric($area)) {
  269 + UdpLog::info('【注册】参数校验', 'mobile:'.$mobile.'area:'.$area);
268 $data['message'] = '手机号码格式不正确'; 270 $data['message'] = '手机号码格式不正确';
269 break; 271 break;
270 } 272 }
@@ -272,6 +274,7 @@ class RegisterController extends WebAction @@ -272,6 +274,7 @@ class RegisterController extends WebAction
272 /* 判断是否是有效的注册方式,防注册机刷 */ 274 /* 判断是否是有效的注册方式,防注册机刷 */
273 $effectiveTime = $this->getSession('effective_time'); 275 $effectiveTime = $this->getSession('effective_time');
274 if ($effectiveTime < time() || empty($effectiveTime)) { 276 if ($effectiveTime < time() || empty($effectiveTime)) {
  277 + UdpLog::info('【注册】超时', 'mobile:'.$mobile.'area:'.$area);
275 $data['message'] = '注册超时'; 278 $data['message'] = '注册超时';
276 break; 279 break;
277 } 280 }
@@ -279,6 +282,7 @@ class RegisterController extends WebAction @@ -279,6 +282,7 @@ class RegisterController extends WebAction
279 //检测验证码不正确 282 //检测验证码不正确
280 $verifyCode = strtolower(trim($this->post('verifyCode'))); //图形验证码 283 $verifyCode = strtolower(trim($this->post('verifyCode'))); //图形验证码
281 if (!PassportModel::verifyCode($verifyCode)) { 284 if (!PassportModel::verifyCode($verifyCode)) {
  285 + UdpLog::info('【注册】验证码不正确', 'mobile:'.$mobile.'area:'.$area.'verifyCode:'.$verifyCode);
282 $data['message'] = '验证码不正确'; 286 $data['message'] = '验证码不正确';
283 break; 287 break;
284 } 288 }
@@ -287,6 +291,7 @@ class RegisterController extends WebAction @@ -287,6 +291,7 @@ class RegisterController extends WebAction
287 $code = trim($this->post('code')); //手机验证码 291 $code = trim($this->post('code')); //手机验证码
288 $password = $this->post('password'); 292 $password = $this->post('password');
289 if (!Helpers::verifyPassword($password)) { 293 if (!Helpers::verifyPassword($password)) {
  294 + UdpLog::info('【注册】密码格式问题', 'mobile:'.$mobile.'area:'.$area.'password:'.$password);
290 $data['message'] = '密码不正确'; 295 $data['message'] = '密码不正确';
291 break; 296 break;
292 } 297 }
@@ -302,6 +307,7 @@ class RegisterController extends WebAction @@ -302,6 +307,7 @@ class RegisterController extends WebAction
302 $ipTimes = intval($ipTimes); 307 $ipTimes = intval($ipTimes);
303 } 308 }
304 if ($ipTimes >= 500) { 309 if ($ipTimes >= 500) {
  310 + UdpLog::info('【注册】ip限制', 'mobile:'.$mobile.'area:'.$area.'ip:'.$ip.'ipTimes:'.$ipTimes);
305 $data['message'] = '由于你IP受限无法注册'; 311 $data['message'] = '由于你IP受限无法注册';
306 break; 312 break;
307 } 313 }
@@ -309,6 +315,7 @@ class RegisterController extends WebAction @@ -309,6 +315,7 @@ class RegisterController extends WebAction
309 /* 验证注册的标识码是否有效 */ 315 /* 验证注册的标识码是否有效 */
310 $data = RegData::validMobileCode($area, $mobile, $code); 316 $data = RegData::validMobileCode($area, $mobile, $code);
311 if (!isset($data['code']) || $data['code'] != 200) { 317 if (!isset($data['code']) || $data['code'] != 200) {
  318 + UdpLog::info('【注册】短信验证码校验', 'mobile:'.$mobile.'area:'.$area.'code:'.$code);
312 $data['message'] = '验证码错误'; 319 $data['message'] = '验证码错误';
313 break; 320 break;
314 } 321 }
@@ -5,7 +5,7 @@ use Shopping\PayModel; @@ -5,7 +5,7 @@ use Shopping\PayModel;
5 use WebPlugin\Pay\PayFactory; 5 use WebPlugin\Pay\PayFactory;
6 use WebPlugin\Pay\Rspparams; 6 use WebPlugin\Pay\Rspparams;
7 use WebPlugin\Pay\weixin\PayNotifyCallBack; 7 use WebPlugin\Pay\weixin\PayNotifyCallBack;
8 -use WebPlugin\PhpLog; 8 +use WebPlugin\UdpLog;
9 9
10 /** 10 /**
11 * 支付Notice 11 * 支付Notice
@@ -13,18 +13,11 @@ use WebPlugin\PhpLog; @@ -13,18 +13,11 @@ use WebPlugin\PhpLog;
13 class NoticeController extends WebAction 13 class NoticeController extends WebAction
14 { 14 {
15 15
16 - // 日志等级,2表示记录信息等级的日志  
17 - const LOG_LEVEL = 2;  
18 - // 向回调通知有关调用日志  
19 - const ORDER_STATUS_LOG = '/Data/logs/pc_pay/order_status';  
20 // 存储的UID键名 16 // 存储的UID键名
21 const SESSION_UID_KEY = 'payUserid'; 17 const SESSION_UID_KEY = 'payUserid';
22 18
23 - private $log = null;  
24 -  
25 public function init() { 19 public function init() {
26 parent::init(); 20 parent::init();
27 - $this->log = new PhpLog(self::ORDER_STATUS_LOG, 'PRC', self::LOG_LEVEL);  
28 } 21 }
29 22
30 /** 23 /**
@@ -35,7 +28,7 @@ class NoticeController extends WebAction @@ -35,7 +28,7 @@ class NoticeController extends WebAction
35 $payment = PayModel::getPaymentById(2); 28 $payment = PayModel::getPaymentById(2);
36 $payService = PayFactory::factory($payment); 29 $payService = PayFactory::factory($payment);
37 30
38 - $this->log->LogInfo("begin alipaynoticeAction"); 31 + UdpLog::info('begin alipaynoticeAction');
39 32
40 $res = $payService->parseResponse($_POST); //支付宝通知使用的 33 $res = $payService->parseResponse($_POST); //支付宝通知使用的
41 if ($res->payResult != -1) { 34 if ($res->payResult != -1) {
@@ -50,7 +43,7 @@ class NoticeController extends WebAction @@ -50,7 +43,7 @@ class NoticeController extends WebAction
50 */ 43 */
51 public function alipayreturnAction() 44 public function alipayreturnAction()
52 { 45 {
53 - $this->log->LogInfo("begin alipayreturnAction"); 46 + UdpLog::info('begin alipayreturnAction');
54 47
55 $payment = PayModel::getPaymentById(2); 48 $payment = PayModel::getPaymentById(2);
56 $payService = PayFactory::factory($payment); 49 $payService = PayFactory::factory($payment);
@@ -65,7 +58,7 @@ class NoticeController extends WebAction @@ -65,7 +58,7 @@ class NoticeController extends WebAction
65 */ 58 */
66 public function alibarcodenoticeAction() 59 public function alibarcodenoticeAction()
67 { 60 {
68 - $this->log->LogInfo("begin alibarcodenoticeAction"); 61 + UdpLog::info('begin alibarcodenoticeAction');
69 $payment = PayModel::getPaymentById(17); 62 $payment = PayModel::getPaymentById(17);
70 $payService = PayFactory::factory($payment); 63 $payService = PayFactory::factory($payment);
71 $res = $payService->parseResponse($_POST); //支付宝通知使用的 64 $res = $payService->parseResponse($_POST); //支付宝通知使用的
@@ -81,7 +74,7 @@ class NoticeController extends WebAction @@ -81,7 +74,7 @@ class NoticeController extends WebAction
81 */ 74 */
82 public function alibarcodereturnAction() 75 public function alibarcodereturnAction()
83 { 76 {
84 - $this->log->LogInfo("begin alibarcodereturnAction"); 77 + UdpLog::info('begin alibarcodereturnAction');
85 $payment = PayModel::getPaymentById(17); 78 $payment = PayModel::getPaymentById(17);
86 $payService = PayFactory::factory($payment); 79 $payService = PayFactory::factory($payment);
87 $res = $payService->parseResponse($_GET); 80 $res = $payService->parseResponse($_GET);
@@ -95,7 +88,7 @@ class NoticeController extends WebAction @@ -95,7 +88,7 @@ class NoticeController extends WebAction
95 */ 88 */
96 public function allinpaynoticeAction() 89 public function allinpaynoticeAction()
97 { 90 {
98 - $this->log->LogInfo("begin allinpaynoticeAction"); 91 + UdpLog::info('begin allinpaynoticeAction');
99 $payment = PayModel::getPaymentById(16); 92 $payment = PayModel::getPaymentById(16);
100 $payService = PayFactory::factory($payment); 93 $payService = PayFactory::factory($payment);
101 $res = $payService->parseResponse($_POST); 94 $res = $payService->parseResponse($_POST);
@@ -111,7 +104,7 @@ class NoticeController extends WebAction @@ -111,7 +104,7 @@ class NoticeController extends WebAction
111 */ 104 */
112 public function allinpayreturnAction() 105 public function allinpayreturnAction()
113 { 106 {
114 - $this->log->LogInfo("begin allinpayreturnAction"); 107 + UdpLog::info('begin allinpayreturnAction');
115 $payment = PayModel::getPaymentById(16); 108 $payment = PayModel::getPaymentById(16);
116 $payService = PayFactory::factory($payment); 109 $payService = PayFactory::factory($payment);
117 $res = $payService->parseResponse($_POST); 110 $res = $payService->parseResponse($_POST);
@@ -125,7 +118,7 @@ class NoticeController extends WebAction @@ -125,7 +118,7 @@ class NoticeController extends WebAction
125 */ 118 */
126 public function aliexpressgatewayreturnAction() 119 public function aliexpressgatewayreturnAction()
127 { 120 {
128 - $this->log->LogInfo("begin aliexpressgatewayreturnAction"); 121 + UdpLog::info('begin aliexpressgatewayreturnAction');
129 $payment = PayModel::getPaymentById(13); 122 $payment = PayModel::getPaymentById(13);
130 $payService = PayFactory::factory($payment); 123 $payService = PayFactory::factory($payment);
131 $res = $payService->parseResponse($_GET); 124 $res = $payService->parseResponse($_GET);
@@ -139,7 +132,7 @@ class NoticeController extends WebAction @@ -139,7 +132,7 @@ class NoticeController extends WebAction
139 */ 132 */
140 public function aliexpressgatewaynoticeAction() 133 public function aliexpressgatewaynoticeAction()
141 { 134 {
142 - $this->log->LogInfo("begin aliexpressgatewaynoticeAction"); 135 + UdpLog::info('begin aliexpressgatewaynoticeAction');
143 $payment = PayModel::getPaymentById(13); 136 $payment = PayModel::getPaymentById(13);
144 $payService = PayFactory::factory($payment); 137 $payService = PayFactory::factory($payment);
145 $res = $payService->parseResponse($_POST); //支付宝通知使用的 138 $res = $payService->parseResponse($_POST); //支付宝通知使用的
@@ -155,7 +148,7 @@ class NoticeController extends WebAction @@ -155,7 +148,7 @@ class NoticeController extends WebAction
155 */ 148 */
156 public function alibanknoticeAction() 149 public function alibanknoticeAction()
157 { 150 {
158 - $this->log->LogInfo("begin alibanknoticeAction"); 151 + UdpLog::info('begin alibanknoticeAction');
159 $payment = PayModel::getPaymentById(12); 152 $payment = PayModel::getPaymentById(12);
160 $payService = PayFactory::factory($payment); 153 $payService = PayFactory::factory($payment);
161 $res = $payService->parseResponse($_POST); 154 $res = $payService->parseResponse($_POST);
@@ -173,7 +166,7 @@ class NoticeController extends WebAction @@ -173,7 +166,7 @@ class NoticeController extends WebAction
173 */ 166 */
174 public function alibankreturnAction() 167 public function alibankreturnAction()
175 { 168 {
176 - $this->log->LogInfo("begin alibanknoticeAction"); 169 + UdpLog::info('begin alibanknoticeAction');
177 $payment = PayModel::getPaymentById(12); 170 $payment = PayModel::getPaymentById(12);
178 $payService = PayFactory::factory($payment); 171 $payService = PayFactory::factory($payment);
179 $res = $payService->parseResponse($_GET); 172 $res = $payService->parseResponse($_GET);
@@ -187,7 +180,7 @@ class NoticeController extends WebAction @@ -187,7 +180,7 @@ class NoticeController extends WebAction
187 */ 180 */
188 public function chinabankAction() 181 public function chinabankAction()
189 { 182 {
190 - $this->log->LogInfo("begin chinabankAction"); 183 + UdpLog::info("begin chinabankAction");
191 $payment = PayModel::getPaymentById(4); 184 $payment = PayModel::getPaymentById(4);
192 $payService = PayFactory::factory($payment); 185 $payService = PayFactory::factory($payment);
193 $res = $payService->parseResponse($_POST); 186 $res = $payService->parseResponse($_POST);
@@ -201,7 +194,7 @@ class NoticeController extends WebAction @@ -201,7 +194,7 @@ class NoticeController extends WebAction
201 */ 194 */
202 public function chinabankautorevAction() 195 public function chinabankautorevAction()
203 { 196 {
204 - $this->log->LogInfo("begin chinabankautorevAction"); 197 + UdpLog::info("begin chinabankautorevAction");
205 $payment = PayModel::getPaymentById(4); 198 $payment = PayModel::getPaymentById(4);
206 $payService = PayFactory::factory($payment); 199 $payService = PayFactory::factory($payment);
207 $res = $payService->parseResponse($_POST); 200 $res = $payService->parseResponse($_POST);
@@ -219,7 +212,7 @@ class NoticeController extends WebAction @@ -219,7 +212,7 @@ class NoticeController extends WebAction
219 */ 212 */
220 public function tenpayAction() 213 public function tenpayAction()
221 { 214 {
222 - $this->log->LogInfo("begin tenpayAction"); 215 + UdpLog::info("begin tenpayAction");
223 $payment = PayModel::getPaymentById(1); 216 $payment = PayModel::getPaymentById(1);
224 $payService = PayFactory::factory($payment); 217 $payService = PayFactory::factory($payment);
225 $rspParams = $payService->parseResponse($_GET); //财付通是以get方式回复的。 218 $rspParams = $payService->parseResponse($_GET); //财付通是以get方式回复的。
@@ -232,7 +225,7 @@ class NoticeController extends WebAction @@ -232,7 +225,7 @@ class NoticeController extends WebAction
232 */ 225 */
233 public function shengpayreturnAction() 226 public function shengpayreturnAction()
234 { 227 {
235 - $this->log->LogInfo("begin shengpayreturnAction"); 228 + UdpLog::info("begin shengpayreturnAction");
236 $payment = PayModel::getPaymentById(11); 229 $payment = PayModel::getPaymentById(11);
237 $payService = PayFactory::factory($payment); 230 $payService = PayFactory::factory($payment);
238 $res = $payService->parseResponse($_POST); 231 $res = $payService->parseResponse($_POST);
@@ -246,7 +239,7 @@ class NoticeController extends WebAction @@ -246,7 +239,7 @@ class NoticeController extends WebAction
246 */ 239 */
247 public function shengpaynoticeAction() 240 public function shengpaynoticeAction()
248 { 241 {
249 - $this->log->LogInfo("begin shengpaynoticeAction"); 242 + UdpLog::info("begin shengpaynoticeAction");
250 $payment = PayModel::getPaymentById(11); 243 $payment = PayModel::getPaymentById(11);
251 $payService = PayFactory::factory($payment); 244 $payService = PayFactory::factory($payment);
252 $res = $payService->parseResponse($_POST); 245 $res = $payService->parseResponse($_POST);
@@ -262,7 +255,7 @@ class NoticeController extends WebAction @@ -262,7 +255,7 @@ class NoticeController extends WebAction
262 */ 255 */
263 public function wechatcallbackAction() 256 public function wechatcallbackAction()
264 { 257 {
265 - $this->log->LogInfo("begin wechatcallbackAction"); 258 + UdpLog::info("begin wechatcallbackAction");
266 $callback = $this->get('callback'); 259 $callback = $this->get('callback');
267 $orderCode = $this->get('ordercode'); 260 $orderCode = $this->get('ordercode');
268 261
@@ -277,14 +270,14 @@ class NoticeController extends WebAction @@ -277,14 +270,14 @@ class NoticeController extends WebAction
277 */ 270 */
278 public function wechatqrcodenotifyAction() 271 public function wechatqrcodenotifyAction()
279 { 272 {
280 - $this->log->LogInfo("begin wechatqrcodenotifyAction"); 273 + UdpLog::info("begin wechatqrcodenotifyAction");
281 274
282 $uid = $this->getUid(); 275 $uid = $this->getUid();
283 if (empty($uid)) { // cookie中获取为空时再从之前保存的session中获取 276 if (empty($uid)) { // cookie中获取为空时再从之前保存的session中获取
284 $uid = $this->getSession(self::SESSION_UID_KEY); 277 $uid = $this->getSession(self::SESSION_UID_KEY);
285 $this->setSession(self::SESSION_UID_KEY, null); 278 $this->setSession(self::SESSION_UID_KEY, null);
286 } 279 }
287 - $this->log->LogInfo($uid); 280 + UdpLog::info($uid);
288 $notify = new PayNotifyCallBack($uid); 281 $notify = new PayNotifyCallBack($uid);
289 $notify->handle(false); 282 $notify->handle(false);
290 } 283 }
@@ -294,7 +287,7 @@ class NoticeController extends WebAction @@ -294,7 +287,7 @@ class NoticeController extends WebAction
294 */ 287 */
295 public function wechatqrcodereturnAction() 288 public function wechatqrcodereturnAction()
296 { 289 {
297 - $this->log->LogInfo("begin wechatqrcodereturnAction"); 290 + UdpLog::info("begin wechatqrcodereturnAction");
298 $dealResult = array( 291 $dealResult = array(
299 'code' => 500, 292 'code' => 500,
300 'message' => '支付失败' 293 'message' => '支付失败'
@@ -321,7 +314,7 @@ class NoticeController extends WebAction @@ -321,7 +314,7 @@ class NoticeController extends WebAction
321 */ 314 */
322 public function unionpaywebreturnAction() 315 public function unionpaywebreturnAction()
323 { 316 {
324 - $this->log->LogInfo("begin unionpaywebreturnAction"); 317 + UdpLog::info("begin unionpaywebreturnAction");
325 $payment = PayModel::getPaymentById(25); 318 $payment = PayModel::getPaymentById(25);
326 $payService = PayFactory::factory($payment); 319 $payService = PayFactory::factory($payment);
327 $res = $payService->parseResponse($_REQUEST); 320 $res = $payService->parseResponse($_REQUEST);
@@ -335,7 +328,7 @@ class NoticeController extends WebAction @@ -335,7 +328,7 @@ class NoticeController extends WebAction
335 */ 328 */
336 public function unionpaywebnoticeAction() 329 public function unionpaywebnoticeAction()
337 { 330 {
338 - $this->log->LogInfo("begin unionpaywebnoticeAction"); 331 + UdpLog::info("begin unionpaywebnoticeAction");
339 $payment = PayModel::getPaymentById(25); 332 $payment = PayModel::getPaymentById(25);
340 $payService = PayFactory::factory($payment); 333 $payService = PayFactory::factory($payment);
341 $res = $payService->parseResponse($_REQUEST); 334 $res = $payService->parseResponse($_REQUEST);
@@ -352,7 +345,7 @@ class NoticeController extends WebAction @@ -352,7 +345,7 @@ class NoticeController extends WebAction
352 */ 345 */
353 public function alimobilenoticeminiAction() 346 public function alimobilenoticeminiAction()
354 { 347 {
355 - $this->log->LogInfo("begin alimobilenoticeminiAction"); 348 + UdpLog::info("begin alimobilenoticeminiAction");
356 $payment = PayModel::getPaymentById(20); 349 $payment = PayModel::getPaymentById(20);
357 $payService = PayFactory::factory($payment); 350 $payService = PayFactory::factory($payment);
358 $res = $payService->parseResponse($_POST); //支付宝通知使用的 351 $res = $payService->parseResponse($_POST); //支付宝通知使用的
@@ -400,19 +393,17 @@ class NoticeController extends WebAction @@ -400,19 +393,17 @@ class NoticeController extends WebAction
400 private function payResultProc($payResult, $payment) 393 private function payResultProc($payResult, $payment)
401 { 394 {
402 // 初始化日志 395 // 初始化日志
403 - $log = $this->log;  
404 - $log->LogInfo('================开始验证登录状态============');  
405 - $log->LogInfo('================支付结果数据为============');  
406 - $log->LogInfo(var_export($payResult, true)); 396 + UdpLog::info('【支付】支付结果数据',var_export($payResult, true);
407 397
408 //判断是否登录 398 //判断是否登录
409 $uid = $this->getUid(); 399 $uid = $this->getUid();
410 if (empty($uid)) { // cookie中获取为空时再从之前保存的session中获取 400 if (empty($uid)) { // cookie中获取为空时再从之前保存的session中获取
  401 + UdpLog::info('【支付】未获取到uid信息');
411 $uid = $this->getSession(self::SESSION_UID_KEY); 402 $uid = $this->getSession(self::SESSION_UID_KEY);
412 $this->setSession(self::SESSION_UID_KEY, null); 403 $this->setSession(self::SESSION_UID_KEY, null);
413 } 404 }
414 405
415 - $log->LogInfo('================已登录,获取到用户ID============'); 406 + UdpLog::info('【支付】已获取UID信息',$uid);
416 407
417 $result = array( 408 $result = array(
418 'code' => 500, 409 'code' => 500,
@@ -424,8 +415,7 @@ class NoticeController extends WebAction @@ -424,8 +415,7 @@ class NoticeController extends WebAction
424 $result = PayModel::procOrderData($uid, $payResult, $payment); 415 $result = PayModel::procOrderData($uid, $payResult, $payment);
425 } 416 }
426 417
427 - $log->LogInfo('================支付结果为============');  
428 - $log->LogInfo(var_export($result, true)); 418 + UdpLog::info('【支付】支付回调java接口返回结果', json_encode($result));
429 419
430 return $result; 420 return $result;
431 } 421 }