作者 lyh

gx

... ... @@ -2,11 +2,14 @@
namespace App\Console\Commands\MonthlyCount;
use App\Helper\FormGlobalsoApi;
use Carbon\Carbon;
use Illuminate\Console\Command;
class InquiryMonthlyCount extends Command
{
const STATUS_ERROR = 400;
public $error = 0;
/**
* The name and signature of the console command.
*
... ... @@ -29,9 +32,40 @@ class InquiryMonthlyCount extends Command
* @time :2023/6/30 9:32
*/
public function handle(){
//统计数据
$arr = [];
// 获取上个月的开始时间
$startTime = Carbon::now()->subMonth()->startOfMonth();
// 获取上个月的结束时间
$endTime = Carbon::now()->subMonth()->endOfMonth();
}
/**
* @param $arr
* @param $domain
* @name :(询盘统计)inquiry
* @author :lyh
* @method :post
* @time :2023/6/14 15:44
*/
public function inquiry($arr,$domain){
$inquiry_list = (new FormGlobalsoApi())->getInquiryList($domain,'',1,100000000);
$arr['count'] = $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);
return $arr;
}
}
... ...
... ... @@ -165,6 +165,7 @@ class BaseController extends Controller
}
break;
case 'file':
case 'video':
$data['file_link'] = url('/b/file_hash/' . $v);
break;
case 'operator_id':
... ...
... ... @@ -62,4 +62,5 @@ class BTemplateController extends BaseController
$BTemplateLogic->templateSave();
$this->response('success');
}
}
... ...
... ... @@ -130,10 +130,8 @@ class BTemplateLogic extends BaseLogic
public function StringProcessing(){
//字符串截取
$this->param['head_html'] = characterTruncation($this->param['html'],'/<header\b[^>]*>(.*?)<\/header>/s');
$this->param['main_html'] = characterTruncation($this->param['html'],'/<main\b[^>]*>(.*?)<\/main>/s');
$this->param['footer_html'] = characterTruncation($this->param['html'],'/<footer\b[^>]*>(.*?)<\/footer>/s');
$this->param['head_css'] = characterTruncation($this->param['html'],'/<style id="vvvebjs-header">(.*?)<\/style>/s');
$this->param['main_css'] = characterTruncation($this->param['html'],'/<style id="vvvebjs-styles">(.*?)<\/style>/s');
$this->param['footer_css'] = characterTruncation($this->param['html'],'/<style id="vvvebjs-footer">(.*?)<\/style>/s');
}
}
... ...