Commit 1fa2e7ec 1fa2e7ecfbb55eed603b7c3138716568a09d3bfa by lemon

*

1 parent 8dbabbec
...@@ -8,6 +8,10 @@ use App\Models\Legal\SongsIp; ...@@ -8,6 +8,10 @@ use App\Models\Legal\SongsIp;
8 use Illuminate\Console\Command; 8 use Illuminate\Console\Command;
9 use Illuminate\Support\Facades\Redis; 9 use Illuminate\Support\Facades\Redis;
10 10
11 /**
12 * Class DealSongIp
13 * @package App\Console\Commands
14 */
11 class DealSongIp extends Command 15 class DealSongIp extends Command
12 { 16 {
13 /** 17 /**
...@@ -58,7 +62,7 @@ class DealSongIp extends Command ...@@ -58,7 +62,7 @@ class DealSongIp extends Command
58 62
59 SongsIp::query()->chunk(5000, function ($res) use ($redis) { 63 SongsIp::query()->chunk(5000, function ($res) use ($redis) {
60 foreach ($res as $item) { 64 foreach ($res as $item) {
61 $key = "company:#company_id#:channel:#channel#:month:#month#:songip"; 65 $key = "company:#company_id#:channel:#channel#:songip";
62 $key = str_replace(['#company_id#', '#channel#'], [$item->company_id, 1], $key); 66 $key = str_replace(['#company_id#', '#channel#'], [$item->company_id, 1], $key);
63 $redis->sadd($key, $item->custom_id); 67 $redis->sadd($key, $item->custom_id);
64 } 68 }
......