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