AgentProfitSync.php 574 B

1234567891011121314151617181920
  1. <?php
  2. namespace App\Console\Commands;
  3. use App\Services\Agent\AgentProfitLedgerService;
  4. use Illuminate\Console\Command;
  5. class AgentProfitSync extends Command
  6. {
  7. protected $signature = 'agent:profit-sync';
  8. protected $description = '按已结算注单实时计算合营代理分成(更新实时保证金)';
  9. public function handle(AgentProfitLedgerService $ledger): int
  10. {
  11. $result = $ledger->sync();
  12. $this->info(json_encode($result, JSON_UNESCAPED_UNICODE));
  13. return $result['failed'] === 0 ? self::SUCCESS : self::FAILURE;
  14. }
  15. }