GeoQuestionResController.php 3.4 KB
<?php
/**
 * @remark :
 * @name   :GeoQuestionResController.php
 * @author :lyh
 * @method :post
 * @time   :2025/7/4 9:37
 */

namespace App\Http\Controllers\Bside\Geo;

use App\Enums\Common\Code;
use App\Http\Controllers\Bside\BaseController;
use App\Http\Logic\Bside\Geo\GeoQuestionResLogic;
use App\Models\Geo\GeoPlatform;
use App\Models\Geo\GeoQuestion;
use Illuminate\Http\Request;

/**
 * @remark :请求数据结果
 * @name   :GeoQuestionResController
 * @author :lyh
 * @method :post
 * @time   :2025/7/4 9:37
 */
class GeoQuestionResController extends BaseController
{
    public function __construct(Request $request)
    {
        parent::__construct($request);
        $this->logic = new GeoQuestionResLogic();
    }
    /**
     * @remark :获取类型
     * @name   :getType
     * @author :lyh
     * @method :post
     * @time   :2025/7/3 10:47
     */
    public function getType(){
        $questionModel = new GeoQuestion();
        $data['type'] = $questionModel->brandType();
        $geoPlatformModel = new GeoPlatform();
        $data['platform'] = $geoPlatformModel->getList();
        return $this->response('success',Code::SUCCESS,$data);
    }

    /**
     * @remark :获取统计数据
     * @name   :getCount
     * @author :lyh
     * @method :post
     * @time   :2025/7/8 17:18
     */
    public function getCount(){
        $data = $this->logic->getCount();
        $this->response('success',Code::SUCCESS,$data);
    }

    /**
     * @remark :获取列表数据
     * @name   :getList
     * @author :lyh
     * @method :post
     * @time   :2025/7/4 9:38
     */
    public function getList(){
        $this->request->validate([
            'project_id'=>'required',
            'type'=>'required'
        ],[
            'project_id.required' => 'project_id不能为空',
            'type.required' => '品牌类型不能为空'
        ]);
        $data = $this->logic->getResultList($this->map,$this->page,$this->row,$this->order,$this->param['sort'] ?? 'desc');
        $this->response('success',Code::SUCCESS,$data);
    }

    /**
     * @remark :
     * @name   :getInfo
     * @author :lyh
     * @method :post
     * @time   :2025/7/4 9:38
     */
    public function getInfo(){
        $this->request->validate([
            'id'=>'required',
        ],[
            'id.required' => 'id不能为空',
        ]);
        $data = $this->logic->getResultInfo();
        $this->response('success',Code::SUCCESS,$data);
    }

    /**
     * @remark :统计数量
     * @name   :countQuantity
     * @author :lyh
     * @method :post
     * @time   :2025/7/21 10:58
     */
    public function countQuantity(){
        $data = $this->logic->countQuantity();
        $data['platform'] = $this->logic->platformHitCount();
        $this->response('success',Code::SUCCESS,$data);
    }

    /**
     * @remark :获取搜索时间
     * @name   :getSearchDate
     * @author :lyh
     * @method :post
     * @time   :2025/7/21 16:35
     */
    public function getSearchDate(){
        $data = $this->logic->getSearchDate();
        $this->response('success',Code::SUCCESS,$data);
    }

    /**
     * @remark :获取当前项目所有标签
     * @name   :getLabel
     * @author :lyh
     * @method :post
     * @time   :2025/8/19 16:39
     */
    public function getLabel(){
        $data = $this->logic->getLabelData();
        $this->response('success',Code::SUCCESS,$data);
    }
}