GeoCount.php 1.1 KB
<?php
/**
 * @remark :
 * @name   :GeoCount.php
 * @author :lyh
 * @method :post
 * @time   :2025/10/13 16:05
 */

namespace App\Console\Commands\Geo;

use App\Models\Geo\GeoQuestionLog;
use Illuminate\Console\Command;
use Illuminate\Support\Carbon;

class GeoCount extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'geo_count';

    public $porject_id;//记录当时执行的project_id

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'geo统计数据';



    public function handle(){

    }

    /**
     * @remark :方法
     * @name   :_action
     * @author :lyh
     * @method :post
     * @time   :2025/10/13 16:20
     */
    public function _action()
    {
        //获取前一天的项目id
        $date = Carbon::yesterday()->format('Y-m-d');
        $start = $date.' 00:00:00';
        $end = $date.' 23:59:59';
        $geoLogModel = new GeoQuestionLog();
        $geoLogModel->formatQuery(['created_at' => ['between',[$start,$end]]])->distinct()->pluck('project_id');
    }
}