|
...
|
...
|
@@ -14,6 +14,7 @@ use App\Models\Geo\GeoPlatform; |
|
|
|
use App\Models\Geo\GeoQuestion;
|
|
|
|
use App\Models\Geo\GeoQuestionResult;
|
|
|
|
use App\Models\Project\Project;
|
|
|
|
use Illuminate\Support\Facades\DB;
|
|
|
|
|
|
|
|
class GeoQuestionLogic extends BaseLogic
|
|
|
|
{
|
|
...
|
...
|
@@ -138,12 +139,12 @@ class GeoQuestionLogic extends BaseLogic |
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 获取未名字的问题列表
|
|
|
|
* 获取未命中的问题列表
|
|
|
|
* @return array
|
|
|
|
* @author Akun
|
|
|
|
* @date 2025/11/25 16:44
|
|
|
|
*/
|
|
|
|
public function getUnHitQuestionList(){
|
|
|
|
public function unHitQuestionList(){
|
|
|
|
$data = GeoQuestionResult::where('project_id',$this->param['project_id'])->where('hit',0)->select('platform','question')->get()->toArray();
|
|
|
|
$list = [];
|
|
|
|
if(!empty($data)){
|
|
...
|
...
|
@@ -160,10 +161,41 @@ class GeoQuestionLogic extends BaseLogic |
|
|
|
|
|
|
|
if(!empty($temp)){
|
|
|
|
foreach ($temp as $kt=>$vt){
|
|
|
|
$list[] = ['question'=>$kt,'platform'=>$vt];
|
|
|
|
$list[] = ['question'=>$kt,'platform'=>array_unique($vt)];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return $this->success($list);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 删除未命中问题
|
|
|
|
* @throws \App\Exceptions\AsideGlobalException
|
|
|
|
* @throws \App\Exceptions\BsideGlobalException
|
|
|
|
* @author Akun
|
|
|
|
* @date 2025/11/27 10:51
|
|
|
|
*/
|
|
|
|
public function delUnHitQuestion(){
|
|
|
|
$question = $this->param['question'];
|
|
|
|
$project_id = $this->param['project_id'];
|
|
|
|
|
|
|
|
DB::beginTransaction();
|
|
|
|
try {
|
|
|
|
//删除问题结果
|
|
|
|
$resultModel = new GeoQuestionResult();
|
|
|
|
$resultModel->del([
|
|
|
|
'project_id' => $project_id,
|
|
|
|
'question' => $question
|
|
|
|
]);
|
|
|
|
|
|
|
|
//删除问题
|
|
|
|
$lists = $this->model->select(['id','question'])->where('project_id', $project_id)->whereJsonContains('question', [['Value' => $question]])->get()->toArray();
|
|
|
|
dd($lists);
|
|
|
|
|
|
|
|
DB::commit();
|
|
|
|
}catch (\Exception $e){
|
|
|
|
DB::rollBack();
|
|
|
|
$this->fail('删除问题失败, error:' . $e->getMessage());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|