@@ -62,21 +71,19 @@ class CreportEight extends Command {
);
Config::set("database.connections.conn",$conn);
DB::connection("conn")->getDatabaseName();
$serverclist=DB::connection("conn")->select(DB::raw("select id from server_details where server_ip='$server_ip'"));
$server_id=$serverclist[0]->id;
if(DB::connection("conn")->getDatabaseName())
{
echo",".$server_ip;
if($server_id<10){
$server_id="0".$server_id;
}
$maxid=DB::connection("conn")->select(DB::raw("SELECT max(crmcall_id) as maxid from $calllog_report where server='$server_id'"));
$maxid=DB::select(DB::raw("SELECT max(crmcall_id) as maxid from $calllog_report where server='$server_id'"));
$maxids=$maxid[0]->maxid;
//$alist=DB::select(DB::raw("SELECT * from crmcalls where id>'$maxids' and created_at<'".date("Y-m-d H:i:s",$logdate-(60*60))."'"));
$alist=DB::select(DB::raw("SELECT * from crmcalls where id>'$maxids'"));
$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'"));
$countnumber=count($alist);
$finalnumber=$countnumber/50;
$finalnumber=floor($finalnumber);
...
...
@@ -90,7 +97,7 @@ class CreportEight extends Command {
//$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"));