CreateOwnerAreaReport.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. namespace App\Console\Commands;
  3. use App\OwnerAreaReport;
  4. use App\Services\LogService;
  5. use App\Services\OwnerService;
  6. use Illuminate\Console\Command;
  7. use Illuminate\Support\Facades\DB;
  8. class CreateOwnerAreaReport extends Command
  9. {
  10. /**
  11. * The name and signature of the console command.
  12. *
  13. * @var string
  14. */
  15. protected $signature = 'createOwnerAreaReport';
  16. /**
  17. * The console command description.
  18. *
  19. * @var string
  20. */
  21. protected $description = 'create owner area report';
  22. /**
  23. * Create a new command instance.
  24. *
  25. * @return void
  26. */
  27. public function __construct()
  28. {
  29. parent::__construct();
  30. }
  31. /**
  32. * 1号生成盘点面积记录,记录留空由人工填写
  33. *
  34. * @return void
  35. */
  36. public function handle()
  37. {
  38. /** @var OwnerService $ownerService */
  39. $ownerService = app('OwnerService');
  40. $chunks = ($ownerService->get([],["ownerStoragePriceModels"],false,true))->chunk(50);
  41. foreach ($chunks as $owners){
  42. app("OwnerAreaReportService")->notExistToInsert($owners);
  43. }
  44. }
  45. }