Merge branch 'main' of https://github.com/Ritikeshyadav/my-freeu into RitikeshFreeu
This commit is contained in:
@@ -5,6 +5,7 @@ namespace App\Models;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use App\Models\UserKyc;
|
||||
|
||||
class Lead extends Model
|
||||
{
|
||||
@@ -43,6 +44,10 @@ class Lead extends Model
|
||||
public function calls(){
|
||||
return $this->hasMany(LeadCall::class, 'leads_id');
|
||||
}
|
||||
|
||||
public function kyc(){
|
||||
return $this->hasMany(UserKyc::class,'users_id');
|
||||
}
|
||||
|
||||
public function owner(){
|
||||
return $this->belongsTo(User::class, 'lead_owner');
|
||||
|
||||
@@ -12,7 +12,7 @@ use Illuminate\Support\Facades\DB;
|
||||
class LeadService{
|
||||
|
||||
public function getAllLeads(){
|
||||
return Lead::with('user', 'product.category')->latest()->get();
|
||||
return Lead::with('kyc','user', 'product.category')->latest()->get();
|
||||
}
|
||||
|
||||
public function totalLead(){
|
||||
|
||||
@@ -210,6 +210,7 @@
|
||||
<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-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>
|
||||
@@ -231,6 +232,15 @@
|
||||
<td>{{$lead->email}}</td>
|
||||
<td>{{$productName[$loop->index]['product_name']}}</td>
|
||||
<td>{{$lead->product == false ? 'No category' : $lead->product->category->category_name}}</td>
|
||||
<td>
|
||||
@if($lead->kyc->isNotEmpty())
|
||||
@foreach($lead->kyc as $kyc)
|
||||
{{$kyc->status}}
|
||||
@endforeach
|
||||
@else
|
||||
N/A
|
||||
@endif
|
||||
</td>
|
||||
<td class='w-75px'>{{$lead->mobile}}</td>
|
||||
<td>{{$lead->lead_status}}</td>
|
||||
<td>
|
||||
|
||||
Reference in New Issue
Block a user