@@ -93,7 +94,10 @@ class OutputReportController extends Controller
publicfunctionshow($id)
{
if($id=="reportdata")
{
{
$dashboarduser=Auth::user();
//if($dashboarduser->usertype == "User"){
// output reports
$products=DB::table('output_products')
->select('output_products.id as productId','output_products.name','output_products.status','output_report.product_id','output_report.id as reportId','output_report.lead_generated','output_report.lead_generated_amount','output_report.lead_closed','output_report.lead_closed_amount')
...
...
@@ -106,13 +110,33 @@ class OutputReportController extends Controller
$totalIncome=DB::select("select sum(income) as income from output_report where user_id=".Auth::user()->id);
$uniqueContacts=DB::select("select count(distinct(number)) as uniquecount from crmcalls where userstatus NOT IN ('InboundDROP','NORECORD') and user_id=".Auth::user()->id);
$uniqueContacts=DB::table('crmcalls')->select('number',DB::raw('count(*) as total'))->whereIn('usersubstatus',["Contacted","Feedback"])->where('created_at','>',date('Y-m-d',time()))->groupBy('number');