<?php

namespace App\Servers;

use App\Models\DrugReportAss;
use Illuminate\Support\Arr;
use Illuminate\Support\Facades\DB;

class DrugReportInfoService
{

    /**
     * 获取生产企业选项
     * @return array
     */
    public function getProduceEntIdOption(): array
    {
        return DrugReportAss::query()
            ->where('produce_ent_id', '!=', '')
            ->pluck('produce_ent_name', 'produce_ent_id')
            ->unique()
            ->toArray();
    }

    /**
     * 获取发货企业选项
     * @return array
     */
    public function getFromRefEntIdOption(): array
    {
        return DrugReportAss::query()
            ->where('from_ref_ent_id', '!=', '')
            ->pluck('from_ent_name', 'from_ref_ent_id')
            ->unique()
            ->toArray();
    }
}
