DrugReportInfoService.php 806 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. namespace App\Servers;
  3. use App\Models\DrugReportAss;
  4. use Illuminate\Support\Arr;
  5. use Illuminate\Support\Facades\DB;
  6. class DrugReportInfoService
  7. {
  8. /**
  9. * 获取生产企业选项
  10. * @return array
  11. */
  12. public function getProduceEntIdOption(): array
  13. {
  14. return DrugReportAss::query()
  15. ->where('produce_ent_id', '!=', '')
  16. ->pluck('produce_ent_name', 'produce_ent_id')
  17. ->unique()
  18. ->toArray();
  19. }
  20. /**
  21. * 获取发货企业选项
  22. * @return array
  23. */
  24. public function getFromRefEntIdOption(): array
  25. {
  26. return DrugReportAss::query()
  27. ->where('from_ref_ent_id', '!=', '')
  28. ->pluck('from_ent_name', 'from_ref_ent_id')
  29. ->unique()
  30. ->toArray();
  31. }
  32. }