作者 刘锟

Merge remote-tracking branch 'origin/master' into akun

... ... @@ -108,13 +108,16 @@ class GeoController extends BaseController
$token = trim($this->param['token']);
$data = GeoConfirm::where(['uniqid' => $token])->first();
if (empty($data)){
return $this->error('当前授权已失效');
return $this->error('确认链接已重置,请查看最新推送链接!');
}
$content = explode("\n", $data->content);
$confirm = explode("\n", $data->confirm);
$type = $data->type;
$status = $data->status;
$result = compact('content', 'confirm', 'type', 'status');
$projectModel = new Project();
$projectInfo = $projectModel->read(['id' => $data->project_id],['title','version']);
$project_title = $projectInfo['title'] ?? '';
$result = compact('content', 'confirm', 'type', 'status', 'project_title');
$this->response('success',Code::SUCCESS,$result);
}
... ...
... ... @@ -68,4 +68,22 @@ class GeoController extends BaseController
$data = $this->logic->saveConfig($this->param);
$this->response('success', Code::SUCCESS, $data);
}
/**
* @remark :统计数据
* @name :getCount
* @author :lyh
* @method :post
* @time :2025/10/30 10:37
*/
public function getCount()
{
$this->request->validate([
'project_id' => 'required',
], [
'project_id.required' => '项目ID不能为空',
]);
$data = $this->logic->getCount();
$this->response('success', Code::SUCCESS, $data);
}
}
... ...
... ... @@ -78,8 +78,10 @@ class SettingFaqController extends BaseController
{
$this->request->validate([
'route'=>'required',
'qa'=>'required',
],[
'route.required' => '路由不能为空',
'qa.required' => 'qa不能为空',
]);
$data = $this->logic->saveFaq();
$this->response('success',Code::SUCCESS,$data);
... ...
... ... @@ -40,7 +40,7 @@ class GeoConfirmLogic extends BaseLogic
public function saveConfirmContent($param)
{
try {
$info = $this->model->read(['project_id' => $param['project_id']]);
$info = $this->model->read(['project_id' => $param['project_id'],'type' => $param['type']]);
if($info === false){
$id = $this->model->addReturnId($param);
}else{
... ...
... ... @@ -9,8 +9,12 @@
namespace App\Http\Logic\Aside\Geo;
use App\Console\Commands\Geo\GeoQuestionRes;
use App\Http\Logic\Aside\BaseLogic;
use App\Models\Geo\GeoConf;
use App\Models\Geo\GeoLink;
use App\Models\Geo\GeoQuestion;
use App\Models\Geo\GeoWritings;
use App\Models\Manage\ManageHr;
use App\Models\Project\KeywordPrefix;
use App\Models\Project\Project;
... ... @@ -97,4 +101,20 @@ class GeoLogic extends BaseLogic
return $this->success(['id'=>$id]);
}
/**
* @remark :获取统计数据
* @name :getCount
* @author :lyh
* @method :post
* @time :2025/10/30 10:39
*/
public function getCount()
{
//获取问题数量
$geo_question_count = GeoQuestion::selectRaw('SUM(JSON_LENGTH(question)) as total_count')->where('project_id',$this->param['project_id'])->value('total_count');
$geo_pr_count = GeoLink::where('project_id',$this->param['project_id'])->count();
$geo_writings_count = GeoWritings::where('project_id',$this->param['project_id'])->count();
return $this->success(['geo_writings_count'=>$geo_writings_count,'geo_pr_count'=>$geo_pr_count,'geo_question_count'=>$geo_question_count]);
}
}
... ...
... ... @@ -591,6 +591,7 @@ Route::middleware(['aloginauth'])->group(function () {
Route::prefix('conf')->group(function () {
Route::any('/getConfig', [Aside\Geo\GeoController::class, 'getConfig'])->name('admin.geo_conf_getConfig');
Route::any('/saveConfig', [Aside\Geo\GeoController::class, 'saveConfig'])->name('admin.geo_conf_saveConfig');
Route::any('/getCount', [Aside\Geo\GeoController::class, 'getCount'])->name('admin.geo_conf_getCount');
});
//geo客户确认信息
Route::prefix('confirm')->group(function () {
... ...