作者 lyh

gx脚本demo

... ... @@ -100,8 +100,8 @@ class MonthAllCount extends Command
$arr['total'] = $arr['month_total'] + ($previousInfo['total'] ?? 0);
}
$country = [];
if(isset($res['data']['data'])){
$country = $res['data']['data'];
if(isset($res['data']['country'])){
$country = $res['data']['country'];
}
$countryData = InquiryFormData::getCountryCount([$start.' 00:00:00',$end.' 00:00:00']);
foreach ($countryData as $v1){
... ...
... ... @@ -123,8 +123,8 @@ class MonthCount extends Command
$arr['total'] = $arr['month_total'] + ($previousInfo['total'] ?? 0);
}
$country = [];
if(isset($res['data']['data'])){
$country = $res['data']['data'];
if(isset($res['data']['country'])){
$country = $res['data']['country'];
}
$countryData = InquiryFormData::getCountryCount([$start.' 00:00:00',$end.' 00:00:00']);
foreach ($countryData as $v1){
... ...
... ... @@ -97,8 +97,8 @@ class MonthProjectCount extends Command
}
echo date('Y-m-d H:i:s') . '加上其他询盘:'.$arr['total'] . PHP_EOL;
$country = [];
if(isset($res['data']['data'])){
$country = $res['data']['data'];
if(isset($res['data']['country'])){
$country = $res['data']['country'];
}
$countryData = InquiryFormData::getCountryCount([$start.' 00:00:00',$end.' 00:00:00']);
foreach ($countryData as $v1){
... ...
... ... @@ -61,6 +61,7 @@ class Demo extends Command
$domain = "https://www.xawellauto.com/";
$token = md5($domain.date("Y-m-d"));
$url = "https://form.globalso.com/api/external-interface/domain_con/15243d63ed5a5738?domain=$domain&token=$token&source=1,2,3,4&num=15";
$url = $url."&sta_date=2024-07";
try {
$res = http_get($url,['charset=utf-8']);
} catch (\Exception | GuzzleException $e) {
... ... @@ -68,7 +69,7 @@ class Demo extends Command
return false;
}
echo date('Y-m-d H:i:s') . '数据:'.json_encode($res) . PHP_EOL;
return true;
return $res;
}
// public function handle(){
... ...
... ... @@ -168,7 +168,7 @@ class FormGlobalsoApi
}
$token = md5($domain.date("Y-m-d"));
$url = "https://form.globalso.com/api/external-interface/domain_con/15243d63ed5a5738?domain=$domain&token=$token&source=1,2,3,4&num=15";
if(!empty($start) && !empty($end)){
if(!empty($start_month)){
$url = $url."&sta_date=$start_month";
}
try {
... ... @@ -177,7 +177,6 @@ class FormGlobalsoApi
errorLog('提交询盘信息失败', $domain, $e);
return false;
}
echo date('Y-m-d H:i:s') . '数据:'.json_encode($res) . PHP_EOL;
return $res;
}
}
... ...