| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- <?php
- namespace App\Module\Task\Commands;
- use App\Module\Game\Services\TaskTempService;
- use Illuminate\Console\Command;
- /**
- * 添加任务进度测试命令
- */
- class AddTaskProgressCommand extends Command
- {
- /**
- * 命令签名
- *
- * @var string
- */
- protected $signature = 'task:add-progress {user_id : 用户ID}';
- /**
- * 命令描述
- *
- * @var string
- */
- protected $description = '添加任务进度更新测试数据';
- /**
- * 执行命令
- *
- * @return int
- */
- public function handle(): int
- {
- $userId = (int) $this->argument('user_id');
- // 添加进度更新数据
- TaskTempService::recordTaskProgressUpdate($userId, 2001, '每日收获任务', 50, [
- 'condition_id' => 1,
- 'current_value' => 5,
- 'target_value' => 10
- ]);
- $this->info("✓ 已为用户 {$userId} 添加任务进度更新数据");
- // 显示当前暂存数据
- $this->call('task:test-temp', ['user_id' => $userId]);
- return 0;
- }
- }
|