$user=DB::select(DB::raw("select id,clientcode,currentstatus,legalstatus from records where id='".$aline->crm_id."' limit 1;"));
if(isset($user[0]))
$alist=DB::connection("conn")->select(DB::raw("SELECT * from crmcalls_archive where id>'$maxids' and created_at>='2018-10-01' and created_at<'2018-11-01'"));
//$update=DB::connection("conn")->select(DB::raw("SELECT crmcall_id as updateid from $calllog_report where server='$server_id' and `state` IN ('DialBegin','DialEnd')"));
//echo $update;
DB::update(DB::raw("UPDATE crmcalls set call_flag='C' where id=$crmcall_id"));