作者 lyh

GX生成白帽报表脚本

... ... @@ -90,6 +90,7 @@ class GeoQuestionController extends BaseController
* @param : keywords->提交的关键字
* @param : status->状态(0:可执行 1:禁止执行)
* @param : project_id->项目id
* @param : type->类型(1:品牌 2:营销)
*/
public function saveGeoQuestion(){
$this->request->validate([
... ... @@ -98,12 +99,14 @@ class GeoQuestionController extends BaseController
'keywords'=>'required',
'url'=>'required',
'status'=>'required',
'type'=>'required',
],[
'project_id.required' => '项目ID不能为空',
'question.required' => '项目ID不能为空',
'keywords.required' => '项目ID不能为空',
'url.required' => '项目ID不能为空',
'status.required' => '项目ID不能为空',
'type.required' => '类型不能为空',
]);
$data = $this->logic->saveGeoQuestion();
$this->response('success',Code::SUCCESS,$data);
... ...
... ... @@ -10,6 +10,7 @@
namespace App\Http\Logic\Aside\Geo;
use App\Http\Logic\Aside\BaseLogic;
use App\Models\Geo\GeoPlatform;
use App\Models\Geo\GeoQuestion;
use App\Models\Project\Project;
... ... @@ -43,7 +44,10 @@ class GeoLogic extends BaseLogic
* @time :2025/7/3 10:47
*/
public function getType(){
return $this->model->brandType();
$data = $this->model->brandType();
$geoPlatformModel = new GeoPlatform();
$data['platform'] = $geoPlatformModel->getList();
return $this->success($data);
}
/**
... ...
<?php
/**
* @remark :
* @name :GeoPlatform.php
* @author :lyh
* @method :post
* @time :2025/7/3 11:16
*/
namespace App\Models\Geo;
use App\Models\Base;
use Illuminate\Support\Facades\Cache;
/**
* @remark :geo设置平台类型
* @name :GeoPlatform
* @author :lyh
* @method :post
* @time :2025/7/3 11:16
*/
class GeoPlatform extends Base
{
protected $table = 'gl_geo_platform';
const STATUS_ON = 1;
/**
* @remark :获取平台列表
* @name :getList
* @author :lyh
* @method :post
* @time :2025/7/3 11:18
*/
public function getList(){
$data = Cache::get('geo_platform');
if(empty($data)){
$data = $this->list(['status'=>$this::STATUS_ON],'id',['name','icon','sort'],'desc');
Cache::put('geo_platform',$data,'12 * 3600');
}
return $data;
}
}
... ...