log promotion for filter

This commit is contained in:
xiaomlove
2022-06-10 04:51:02 +08:00
parent 86bc6ae900
commit 82a53995f3
2 changed files with 6 additions and 5 deletions
+3 -3
View File
@@ -77,9 +77,9 @@ class Test extends Command
*/ */
public function handle() public function handle()
{ {
$torrent = Torrent::query()->first(); $torrent = \App\Models\Torrent::query()->find(3);
$torrent->name = Carbon::now()->toDateTimeString(); $promotionInfo = apply_filter('torrent_promotion', $torrent->toArray());
$torrent->update(['seeders' => 100]); dd($promotionInfo);
} }
+3 -2
View File
@@ -679,9 +679,10 @@ class TrackerRepository extends BaseRepository
$spStateReal = $torrent->spStateReal; $spStateReal = $torrent->spStateReal;
$log .= "[SP_STATE_REAL]: $spStateReal"; $log .= "[SP_STATE_REAL]: $spStateReal";
$promotionInfo = apply_filter('torrent_promotion', $torrent->toArray()); $promotionInfo = apply_filter('torrent_promotion', $torrent->toArray());
if ($promotionInfo) { do_log("promotionInfo from filter torrent_promotion by torrent: " . $torrent->toArray() . ", get : " . json_encode($promotionInfo));
if ($promotionInfo['sp_state'] != $spStateReal) {
$spStateReal = $promotionInfo['sp_state']; $spStateReal = $promotionInfo['sp_state'];
$log .= "[CHANGE_SP_STATE_BY_FILTER_TORRENT_PROMOTION]: $spStateReal"; $log .= "[CHANGE_SP_STATE_REAL_BY_FILTER_TORRENT_PROMOTION]: $spStateReal";
} }
$uploaderRatio = Setting::get('torrent.uploaderdouble'); $uploaderRatio = Setting::get('torrent.uploaderdouble');
$log .= ", spStateReal: $spStateReal, uploaderRatio: $uploaderRatio"; $log .= ", spStateReal: $spStateReal, uploaderRatio: $uploaderRatio";