芝麻web文件管理V1.00
编辑当前文件:/home/sditechnicalteam/public_html/database/seeders/LeadsTableSeeder.php
count((int)$count) ->make() ->each(function (Lead $lead) use($faker,$companyId) { $lead->company_id = $companyId; $lead->agent_id = $faker->randomElement($this->getLeadAgent($companyId)); /* @phpstan-ignore-line */ $lead->source_id = $faker->randomElement($this->getLeadSource($companyId)); /* @phpstan-ignore-line */ $lead->status_id = $faker->randomElement($this->getLeadStatus($companyId)); /* @phpstan-ignore-line */ $lead->save(); }); } private function getLeadAgent($companyId) { return LeadAgent::with('user') ->where('company_id', $companyId) ->get()->pluck('id')->toArray(); } private function getLeadStatus($companyId) { return LeadStatus::where('company_id', $companyId)->get()->pluck('id')->toArray(); } private function getLeadSource($companyId) { return LeadSource::where('company_id', $companyId)->get()->pluck('id')->toArray(); } }