12345678910111213141516171819202122232425262728 |
- <?php
- namespace App\Service\Tencent;
- use App\Log;
- use App\Models\Tencent\TxClickRecord;
- use App\Support\EmailQueue;
- class TencentService
- {
- public static function clickRecordSave($data) {
- # 数据映射
- try{
- $data['device_os_type'] = $data['device_os_type'] == 'ios' ? 2 : ($data['device_os_type'] == 'android' ? 1 : 0);
- $data['click_time'] = date('Y-m-d H:i:s', $data['click_time']);
- $data['process_time'] = date('Y-m-d H:i:s', $data['process_time']);
- return TxClickRecord::saveData($data);
- } catch (\Exception $exception) {
- Log::logError('记录腾讯点击回调事件异常', [
- 'params' => $data, 'file' => $exception->getFile(), 'line' => $exception->getLine(), 'message' => $exception->getMessage(),
- 'trace' => $exception->getTraceAsString()
- ], 'clickRecordSaveError');
- EmailQueue::rPush('记录腾讯点击回调事件异常', json_encode(['file' => $exception->getFile(), 'line' => $exception->getLine(), 'message' => $exception->getMessage()])
- , ['song.shen@kuxuan-inc.com'], '猎羽');
- }
- }
- }
|