作者 lyh

gx

@@ -2,11 +2,14 @@ @@ -2,11 +2,14 @@
2 2
3 namespace App\Console\Commands\MonthlyCount; 3 namespace App\Console\Commands\MonthlyCount;
4 4
  5 +use App\Helper\FormGlobalsoApi;
5 use Carbon\Carbon; 6 use Carbon\Carbon;
6 use Illuminate\Console\Command; 7 use Illuminate\Console\Command;
7 8
8 class InquiryMonthlyCount extends Command 9 class InquiryMonthlyCount extends Command
9 { 10 {
  11 + const STATUS_ERROR = 400;
  12 + public $error = 0;
10 /** 13 /**
11 * The name and signature of the console command. 14 * The name and signature of the console command.
12 * 15 *
@@ -29,9 +32,40 @@ class InquiryMonthlyCount extends Command @@ -29,9 +32,40 @@ class InquiryMonthlyCount extends Command
29 * @time :2023/6/30 9:32 32 * @time :2023/6/30 9:32
30 */ 33 */
31 public function handle(){ 34 public function handle(){
  35 + //统计数据
  36 + $arr = [];
32 // 获取上个月的开始时间 37 // 获取上个月的开始时间
33 $startTime = Carbon::now()->subMonth()->startOfMonth(); 38 $startTime = Carbon::now()->subMonth()->startOfMonth();
34 // 获取上个月的结束时间 39 // 获取上个月的结束时间
35 $endTime = Carbon::now()->subMonth()->endOfMonth(); 40 $endTime = Carbon::now()->subMonth()->endOfMonth();
36 } 41 }
  42 +
  43 + /**
  44 + * @param $arr
  45 + * @param $domain
  46 + * @name :(询盘统计)inquiry
  47 + * @author :lyh
  48 + * @method :post
  49 + * @time :2023/6/14 15:44
  50 + */
  51 + public function inquiry($arr,$domain){
  52 + $inquiry_list = (new FormGlobalsoApi())->getInquiryList($domain,'',1,100000000);
  53 + $arr['count'] = $inquiry_list['data']['total'];
  54 + //询盘国家统计
  55 + $countryData = $inquiry_list['data']['data'];
  56 + $countryArr = [];
  57 + foreach ($countryData as $v1){
  58 + if(isset($countryArr[$v1['country']])){
  59 + $countryArr[$v1['country']]++;
  60 + }else{
  61 + $countryArr[$v1['country']] = 0;
  62 + }
  63 + }
  64 + arsort($countryArr);
  65 + $top20 = array_slice($countryArr, 0, 20, true);
  66 + $arr['country'] = json_encode($top20);
  67 +
  68 + return $arr;
  69 + }
  70 +
37 } 71 }
@@ -165,6 +165,7 @@ class BaseController extends Controller @@ -165,6 +165,7 @@ class BaseController extends Controller
165 } 165 }
166 break; 166 break;
167 case 'file': 167 case 'file':
  168 + case 'video':
168 $data['file_link'] = url('/b/file_hash/' . $v); 169 $data['file_link'] = url('/b/file_hash/' . $v);
169 break; 170 break;
170 case 'operator_id': 171 case 'operator_id':
@@ -62,4 +62,5 @@ class BTemplateController extends BaseController @@ -62,4 +62,5 @@ class BTemplateController extends BaseController
62 $BTemplateLogic->templateSave(); 62 $BTemplateLogic->templateSave();
63 $this->response('success'); 63 $this->response('success');
64 } 64 }
  65 +
65 } 66 }
@@ -130,10 +130,8 @@ class BTemplateLogic extends BaseLogic @@ -130,10 +130,8 @@ class BTemplateLogic extends BaseLogic
130 public function StringProcessing(){ 130 public function StringProcessing(){
131 //字符串截取 131 //字符串截取
132 $this->param['head_html'] = characterTruncation($this->param['html'],'/<header\b[^>]*>(.*?)<\/header>/s'); 132 $this->param['head_html'] = characterTruncation($this->param['html'],'/<header\b[^>]*>(.*?)<\/header>/s');
133 - $this->param['main_html'] = characterTruncation($this->param['html'],'/<main\b[^>]*>(.*?)<\/main>/s');  
134 $this->param['footer_html'] = characterTruncation($this->param['html'],'/<footer\b[^>]*>(.*?)<\/footer>/s'); 133 $this->param['footer_html'] = characterTruncation($this->param['html'],'/<footer\b[^>]*>(.*?)<\/footer>/s');
135 $this->param['head_css'] = characterTruncation($this->param['html'],'/<style id="vvvebjs-header">(.*?)<\/style>/s'); 134 $this->param['head_css'] = characterTruncation($this->param['html'],'/<style id="vvvebjs-header">(.*?)<\/style>/s');
136 - $this->param['main_css'] = characterTruncation($this->param['html'],'/<style id="vvvebjs-styles">(.*?)<\/style>/s');  
137 $this->param['footer_css'] = characterTruncation($this->param['html'],'/<style id="vvvebjs-footer">(.*?)<\/style>/s'); 135 $this->param['footer_css'] = characterTruncation($this->param['html'],'/<style id="vvvebjs-footer">(.*?)<\/style>/s');
138 } 136 }
139 } 137 }