|
...
|
...
|
@@ -3,17 +3,21 @@ |
|
|
|
namespace App\Http\Controllers\Bside;
|
|
|
|
|
|
|
|
use App\Enums\Common\Code;
|
|
|
|
use App\Helper\Common;
|
|
|
|
use App\Helper\FormGlobalsoApi;
|
|
|
|
use App\Http\Logic\Bside\User\UserLogic;
|
|
|
|
use App\Http\Logic\Bside\User\UserLoginLogic;
|
|
|
|
use App\Models\Project\DeployBuild;
|
|
|
|
use App\Models\Project\Project;
|
|
|
|
use App\Models\Project\Project as ProjectModel;
|
|
|
|
use App\Models\SmsLog;
|
|
|
|
use App\Models\User\ProjectMenu as ProjectMenuModel;
|
|
|
|
use App\Models\User\ProjectRole as ProjectRoleModel;
|
|
|
|
use App\Models\User\User as UserModel;
|
|
|
|
use Carbon\Carbon;
|
|
|
|
use Illuminate\Http\Request;
|
|
|
|
use Illuminate\Support\Facades\Cache;
|
|
|
|
use Illuminate\Support\Facades\DB;
|
|
|
|
use Mrgoon\AliSms\AliSms;
|
|
|
|
|
|
|
|
/***
|
|
...
|
...
|
@@ -144,20 +148,50 @@ class ComController extends BaseController |
|
|
|
}
|
|
|
|
|
|
|
|
public function ceshi(){
|
|
|
|
$inquiry_list = (new FormGlobalsoApi())->getInquiryList('https://demomark.globalso.com/','',1,100000000);
|
|
|
|
//询盘国家统计
|
|
|
|
$countryData = $inquiry_list['data']['data'];
|
|
|
|
$countryArr = [];
|
|
|
|
foreach ($countryData as $v1){
|
|
|
|
if(isset($countryArr[$v1['country']])){
|
|
|
|
$countryArr[$v1['country']]++;
|
|
|
|
$deployModel = new DeployBuild();
|
|
|
|
$list = $deployModel->list();
|
|
|
|
$data = [];
|
|
|
|
$yesterday = Carbon::yesterday()->toDateString();
|
|
|
|
foreach ($list as $v){
|
|
|
|
$v['test_domain'] = 'https://demomark.globalso.com/';
|
|
|
|
$arr = [];
|
|
|
|
$arr['pv_num'] = DB::table('gl_customer_visit_item')->whereDate('updated_date', $yesterday)->where('domain',$v['test_domain'])->count();
|
|
|
|
$arr['ip_num'] = DB::table('gl_customer_visit')->whereDate('updated_date', $yesterday)->where('domain',$v['test_domain'])->count();
|
|
|
|
$inquiry_list = (new FormGlobalsoApi())->getInquiryList($v['test_domain'],'',1,100000000);
|
|
|
|
if($inquiry_list['status'] == 400){
|
|
|
|
$arr['inquiry_num'] = 0;
|
|
|
|
}else{
|
|
|
|
$countryArr[$v1['country']] = 0;
|
|
|
|
$arr['inquiry_num'] = $inquiry_list['data']['total'];
|
|
|
|
//询盘国家统计
|
|
|
|
$countryData = $inquiry_list['data']['data'];
|
|
|
|
$countryArr = [];
|
|
|
|
foreach ($countryData as $v1){
|
|
|
|
if(isset($countryArr[$v1['country']])){
|
|
|
|
$countryArr[$v1['country']]++;
|
|
|
|
}else{
|
|
|
|
$countryArr[$v1['country']] = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
arsort($countryArr);
|
|
|
|
$top20 = array_slice($countryArr, 0, 20, true);
|
|
|
|
$arr['country'] = json_encode($top20);
|
|
|
|
var_dump($arr['country']);
|
|
|
|
die();
|
|
|
|
}
|
|
|
|
$arr['date'] = $yesterday;
|
|
|
|
$rank_info = DB::table('gl_rank_data')->where(['updated_date'=>$yesterday,'lang'=>''])->select(['compliance_day'])->first();
|
|
|
|
if(empty($rank_info)){
|
|
|
|
$arr['compliance_day'] = 0;
|
|
|
|
}else{
|
|
|
|
$arr['compliance_day'] = $rank_info->compliance_day;
|
|
|
|
}
|
|
|
|
$arr['service_day'] = $v['service_duration'] - Common::getDaysToTargetDate($v['created_at']);
|
|
|
|
$arr['project_id'] = $v['project_id'];
|
|
|
|
$arr['created_at'] = date('Y-m-d H:i:s');
|
|
|
|
$arr['updated_at'] = date('Y-m-d H:i:s');
|
|
|
|
$data[] = $arr;
|
|
|
|
}
|
|
|
|
arsort($countryArr);
|
|
|
|
$top20 = array_slice($countryArr, 0, 20, true);
|
|
|
|
return json_encode($top20);
|
|
|
|
|
|
|
|
//判断数据是否存在
|
|
|
|
DB::table('gl_count')->insert($data);
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|