作者 李宇航

合并分支 'lyh-server' 到 'master'

变更数据



查看合并请求 !2949
@@ -13,6 +13,7 @@ use App\Models\Geo\GeoQuestionLog; @@ -13,6 +13,7 @@ use App\Models\Geo\GeoQuestionLog;
13 use App\Models\Geo\GeoQuestionResult; 13 use App\Models\Geo\GeoQuestionResult;
14 use Illuminate\Console\Command; 14 use Illuminate\Console\Command;
15 use Illuminate\Support\Carbon; 15 use Illuminate\Support\Carbon;
  16 +use App\Models\Geo\GeoCount as GeoCountModel;
16 17
17 class GeoCount extends Command 18 class GeoCount extends Command
18 { 19 {
@@ -50,6 +51,7 @@ class GeoCount extends Command @@ -50,6 +51,7 @@ class GeoCount extends Command
50 */ 51 */
51 public function _action() 52 public function _action()
52 { 53 {
  54 + $geoCountModel = new GeoCountModel();
53 //获取前一天的项目id 55 //获取前一天的项目id
54 $date = Carbon::yesterday()->format('Y-m-d'); 56 $date = Carbon::yesterday()->format('Y-m-d');
55 $start = $date.' 00:00:00'; 57 $start = $date.' 00:00:00';
@@ -76,7 +78,7 @@ class GeoCount extends Command @@ -76,7 +78,7 @@ class GeoCount extends Command
76 $data[$platform] = $geoQuestionResModel->counts(['project_id' => $item,'hit'=>['!=',0],'platform'=>$platform,'created_at' => ['between',[$start,$end]]]); 78 $data[$platform] = $geoQuestionResModel->counts(['project_id' => $item,'hit'=>['!=',0],'platform'=>$platform,'created_at' => ['between',[$start,$end]]]);
77 } 79 }
78 //新增一条数据 80 //新增一条数据
79 - $geoQuestionResModel->addReturnId($data); 81 + $geoCountModel->addReturnId($data);
80 } 82 }
81 return true; 83 return true;
82 } 84 }
  1 +<?php
  2 +/**
  3 + * @remark :
  4 + * @name :GeoCount.php
  5 + * @author :lyh
  6 + * @method :post
  7 + * @time :2025/10/14 10:23
  8 + */
  9 +
  10 +namespace App\Models\Geo;
  11 +
  12 +use App\Models\Base;
  13 +
  14 +class GeoCount extends Base
  15 +{
  16 + protected $table = 'gl_geo_count';
  17 +}