Merge branch 'main' of https://github.com/Ritikeshyadav/my-freeu into RitikeshFreeu

This commit is contained in:
Ritikesh yadav
2024-04-29 14:42:26 +05:30
4 changed files with 14 additions and 4 deletions

View File

@@ -31,6 +31,7 @@ class ManageLeadController extends Controller
if (!$check) {
abort(404);
}
// dd($this->lead->getAllLeads());
return view('Admin.Pages.manage_leads.manage_leads', [
'leads' => $this->lead->getAllLeads(),
'leadCount' => $this->lead->totalLead(),

View File

@@ -18,6 +18,11 @@ class Lead extends Model
{
return $this->belongsTo(User::class,'lead_owner','id');
}
public function leadSourceName()
{
return $this->belongsTo(User::class,'lead_source');
}
public function user()
{
@@ -44,7 +49,7 @@ class Lead extends Model
public function calls(){
return $this->hasMany(LeadCall::class, 'leads_id');
}
public function kyc(){
return $this->belongsTo(UserKyc::class,'users_id');
}

View File

@@ -12,7 +12,7 @@ use Illuminate\Support\Facades\DB;
class LeadService{
public function getAllLeads(){
return Lead::with('kyc','user', 'product.category')->latest()->get();
return Lead::with('kyc','leadSourceName','user', 'product.category')->latest()->get();
// dd(Lead::with('kyc','user', 'product.category')->latest()->first());
}

View File

@@ -255,7 +255,8 @@
<th class="min-w-125px w-125px align-top">Email</th>
<th class="min-w-50px w-200px align-top">Product Name</th>
<th class="min-w-50px w-200px align-top">Product Category</th>
<th class="min-w-50px w-200px align-top">Status</th>
<th class="min-w-50px w-200px align-top">KYC Status</th>
<th class="min-w-50px w-200px align-top">Lead Source</th>
<th class="min-w-50px w-75px align-top">Contact Number</th>
<th class="min-w-50px w-75px align-top">Lead Status</th>
<th class="min-w-50px w-75px align-top">Created Date</th>
@@ -288,9 +289,12 @@
@endforeach --}}
@else
<td>
N/A
No kyc
</td>
@endif
<td>
{{$lead->leadSourceName != null ? $lead->leadSourceName->name : 'No lead assigned'}}
</td>
<td class='w-75px'>{{ $lead->mobile }}</td>
<td>{{ $lead->lead_status }}</td>
<td>