|
@@ -6,6 +6,7 @@ use http\Exception\RuntimeException;
|
|
|
use Illuminate\Console\Command;
|
|
|
use Illuminate\Support\Facades\DB;
|
|
|
use Illuminate\Support\Facades\Redis;
|
|
|
+use Modules\Audience\Services\UserGroupService;
|
|
|
use Modules\Common\Errors\Errors;
|
|
|
use Modules\Common\Exceptions\CommonBusinessException;
|
|
|
|
|
@@ -30,15 +31,24 @@ class ContentTest extends Command
|
|
|
*/
|
|
|
public function handle(): void
|
|
|
{
|
|
|
- $result = DB::table('promotions')
|
|
|
- ->where(['puid' => 0])
|
|
|
- ->get();
|
|
|
- foreach ($result as $item) {
|
|
|
- DB::table('promotions')
|
|
|
- ->where('id', $item->id)
|
|
|
- ->update([
|
|
|
- 'puid' => DB::table('users')->where('id', $item->uid)->value('pid')
|
|
|
- ]);
|
|
|
- }
|
|
|
+ $tags = [
|
|
|
+ 'attention_hour' => '0-6',
|
|
|
+ 'in_48_hour' => 1,
|
|
|
+ 'interact_hour' => '0-6',
|
|
|
+ 'last_watch_day' => '0-2',
|
|
|
+ 'register_day' => '0-2',
|
|
|
+ 'total_watch_day' => '0-2',
|
|
|
+ 'charge_type' => 1,
|
|
|
+ 'total_charge_money' => '1-1000',
|
|
|
+ 'avg_charge_money' => '2-300',
|
|
|
+ 'charge_num' => '1-1',
|
|
|
+ 'remain_coin' => '0-1',
|
|
|
+ 'last_charge_day' => '0-4',
|
|
|
+ 'video_watch' => [1,2,3],
|
|
|
+ 'video_charge' => [4,5]
|
|
|
+ ];
|
|
|
+
|
|
|
+ $sql = UserGroupService::getSQL($tags)->distinct()->count('a.uid');
|
|
|
+ dump($sql);
|
|
|
}
|
|
|
}
|