企微短剧业务系统

TencentService.php 1.1KB

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