优化增加第三方【每日推送】原始数据记录日志.log
This commit is contained in:
@@ -15,6 +15,7 @@ use app\common\model\MallSession;
|
||||
use app\common\model\MallOrder;
|
||||
use app\common\model\MallUserAsset;
|
||||
use app\common\library\MallPlayxRatios;
|
||||
use app\common\library\MallDailyPushRawLogger;
|
||||
use app\common\model\MallAddress;
|
||||
use support\think\Db;
|
||||
use Webman\Http\Request;
|
||||
@@ -188,13 +189,15 @@ class Playx extends Api
|
||||
return $response;
|
||||
}
|
||||
|
||||
$rawBody = $request->rawBody();
|
||||
$body = $request->post();
|
||||
if (empty($body)) {
|
||||
$raw = $request->rawBody();
|
||||
if ($raw) {
|
||||
$body = json_decode($raw, true) ?? [];
|
||||
}
|
||||
if (empty($body) && $rawBody !== '') {
|
||||
$body = json_decode($rawBody, true) ?? [];
|
||||
}
|
||||
if ($rawBody === '') {
|
||||
$rawBody = json_encode($body, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
|
||||
}
|
||||
MallDailyPushRawLogger::log($request, $rawBody);
|
||||
|
||||
$secret = config('playx.daily_push_secret', '');
|
||||
if ($secret !== '') {
|
||||
@@ -1101,7 +1104,7 @@ SQL;
|
||||
|
||||
$phone = trim(strval($request->post('phone', '')));
|
||||
$receiverName = trim(strval($request->post('receiver_name', '')));
|
||||
$region = $request->post('region', '');
|
||||
$region = MallAddress::normalizeRegion($request->post('region', ''));
|
||||
$detailAddress = trim(strval($request->post('detail_address', '')));
|
||||
$defaultSetting = strval($request->post('default_setting', '0')) === '1' ? 1 : 0;
|
||||
|
||||
@@ -1171,7 +1174,7 @@ SQL;
|
||||
$updates['receiver_name'] = trim(strval($request->post('receiver_name', '')));
|
||||
}
|
||||
if ($request->post('region', null) !== null) {
|
||||
$updates['region'] = $request->post('region', '');
|
||||
$updates['region'] = MallAddress::normalizeRegion($request->post('region', ''));
|
||||
}
|
||||
if ($request->post('detail_address', null) !== null) {
|
||||
$updates['detail_address'] = trim(strval($request->post('detail_address', '')));
|
||||
|
||||
Reference in New Issue
Block a user