|
@@ -9,6 +9,7 @@ use App\Modules\User\Services\ReadRecordService;
|
|
use Exception;
|
|
use Exception;
|
|
use Illuminate\Support\Facades\DB;
|
|
use Illuminate\Support\Facades\DB;
|
|
use Illuminate\Support\Facades\Log;
|
|
use Illuminate\Support\Facades\Log;
|
|
|
|
+use Redis;
|
|
|
|
|
|
/**
|
|
/**
|
|
*
|
|
*
|
|
@@ -42,7 +43,7 @@ abstract class PaySuccessAbstract
|
|
return true;
|
|
return true;
|
|
} catch (Exception $e) {
|
|
} catch (Exception $e) {
|
|
DB::rollback();
|
|
DB::rollback();
|
|
- Log::error('pay.success: ' . $e->getMessage().' '.$e->getTraceAsString());
|
|
|
|
|
|
+ Log::error('pay.success: ' . $e->getMessage() . ' ' . $e->getTraceAsString());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -68,13 +69,19 @@ abstract class PaySuccessAbstract
|
|
return $count + 1;
|
|
return $count + 1;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private function getReportType(int $channel_id)
|
|
|
|
+ {
|
|
|
|
+ return Redis::hGet('channel:setting:' . $channel_id, 'tiktok_report_type') ?? QappTikTokUserCharge::REGISTER_24_CHARGE;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
protected function addQueue()
|
|
protected function addQueue()
|
|
{
|
|
{
|
|
$bid = ReadRecordService::getSimpleFirstReadRecord($this->order->uid);
|
|
$bid = ReadRecordService::getSimpleFirstReadRecord($this->order->uid);
|
|
$book_id = book_hash_encode($bid);
|
|
$book_id = book_hash_encode($bid);
|
|
$book = BookConfig::where('bid', $bid)->select('book_name')->first();
|
|
$book = BookConfig::where('bid', $bid)->select('book_name')->first();
|
|
$book_name = $book ? $book->book_name : '';
|
|
$book_name = $book ? $book->book_name : '';
|
|
- $job = new QappTikTokUserCharge($this->order->uid, $this->order->price, $this->order->created_at, QappTikTokUserCharge::CURRENT_DAY_REGISTER, $book_id, $book_name);
|
|
|
|
|
|
+ $job = new QappTikTokUserCharge($this->order->uid, $this->order->price, $this->order->created_at, $this->getReportType($this->order->distribution_channel_id), $book_id, $book_name);
|
|
dispatch($job->onConnection('rabbitmq')->onQueue('qapp_tiktok_user_charge_queue'));
|
|
dispatch($job->onConnection('rabbitmq')->onQueue('qapp_tiktok_user_charge_queue'));
|
|
}
|
|
}
|
|
}
|
|
}
|