master
ljl 7 months ago
parent db80309949
commit 55a95a9e67

@ -0,0 +1,11 @@
<?php
namespace Base\Tool;
use Think\Log as ThinkLog;
class Log {
public static function write($message, $level = ThinkLog::INFO, $logPath = 'common') {
$destination = C('LOG_PATH'). $logPath . '/' . date('y_m_d').'.log';
ThinkLog::write($message, $level, '', $destination);
}
}

@ -2,6 +2,7 @@
namespace Sdk\Controller;
use Base\Tool\Log;
use Think\Controller;
use Common\Api\GameApi;
@ -15,8 +16,7 @@ use Org\JtpaySDK\Jtpay;
use Org\GoldPig\GoldPig;
use Base\Tool\Redis;
use Think\Log as ThinkLog;
class ExchangeController extends BaseController{
/**
@ -137,6 +137,9 @@ class ExchangeController extends BaseController{
]);
$payPage = "pay_way_v1";
Log::write('api_ver: ' . $request['api_ver'], ThinkLog::INFO, 'payment');
if (isset($request['api_ver']) && $request['api_ver'] >= 2) {
$payPage = "pay_way";
// 用户

@ -2,6 +2,7 @@
namespace Sdk\Controller;
use Base\Tool\Log as ToolLog;
use Think\Controller;
use Org\JtpaySDK\Jtpay;
use Org\SqpaySDK\Sqpay;
@ -56,11 +57,18 @@ class SpendController extends Controller {
echo "access deny!";
die();
}
ToolLog::write('user_token: ' . $user_token, Log::INFO, 'payment');
ToolLog::write('user_id: ' . $user_id, Log::INFO, 'payment');
ToolLog::write('game_id: ' . $game_id, Log::INFO, 'payment');
$userId = M('user_token', 'tab_')->where([
'user_token'=>$user_token,
'user_id' => $user_id,
'game_id' => $game_id
])->getField('id');
ToolLog::write('sql: ' . M('ususer_tokener','tab_')->getLastSql(), 'payment');
ToolLog::write('userId: ' . $userId, Log::INFO, 'payment');
if (!$userId) {
echo $user_token."请重新登入!".$user_id.$game_id;
die();

Loading…
Cancel
Save