作者 刘锟

合并分支 'akun' 到 'master'

Akun



查看合并请求 !3348
... ... @@ -126,4 +126,14 @@ class GeoQuestionController extends BaseController
$data = $this->logic->delGeoQuestion();
$this->response('success',Code::SUCCESS,$data);
}
public function unHitQuestionList(){
$this->request->validate([
'project_id'=>'required',
],[
'project_id.required' => '项目ID不能为空',
]);
$data = $this->logic->getUnHitQuestionList();
$this->response('success',Code::SUCCESS,$data);
}
}
... ...
... ... @@ -12,6 +12,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\Geo\GeoQuestionResult;
use App\Models\Project\Project;
class GeoQuestionLogic extends BaseLogic
... ... @@ -135,4 +136,27 @@ class GeoQuestionLogic extends BaseLogic
$data = $this->model->del(['id'=>['in',$this->param['ids']]]);
return $this->success($data);
}
/**
* 获取未名字的问题列表
* @return array
* @author Akun
* @date 2025/11/25 16:44
*/
public function getUnHitQuestionList(){
$data = GeoQuestionResult::where('project_id',$this->param['project_id'])->where('hit',0)->pluck('platform','question')->toArray();
$list = [];
if(!empty($data)){
$question_list = [];
foreach ($data as $key => $item){
if(in_array($key,$question_list)){
array_push($list[$key],$item);
}else{
$list[$key] = $item;
$question_list[] = $key;
}
}
}
return $this->success($data);
}
}
... ...
... ... @@ -574,6 +574,7 @@ Route::middleware(['aloginauth'])->group(function () {
Route::any('/getGeoQuestionList', [Aside\Geo\GeoQuestionController::class, 'getGeoQuestionList'])->name('admin.geo_question_getGeoQuestionList');
Route::any('/saveGeoQuestion', [Aside\Geo\GeoQuestionController::class, 'saveGeoQuestion'])->name('admin.geo_question_saveGeoQuestion');
Route::any('/delGeoQuestion', [Aside\Geo\GeoQuestionController::class, 'delGeoQuestion'])->name('admin.geo_question_delGeoQuestion');
Route::any('/unHitQuestionList', [Aside\Geo\GeoQuestionController::class, 'unHitQuestionList'])->name('admin.geo_question_unHitQuestionList');
});
//文章列表
Route::prefix('article')->group(function () {
... ...