added column status in leads

This commit is contained in:
cj201199
2024-04-26 11:24:09 +05:30
parent 405bea160e
commit 6a48e8ce82
3 changed files with 16 additions and 1 deletions

View File

@@ -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');

View File

@@ -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(){

View File

@@ -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>