|
...
|
...
|
@@ -6,6 +6,7 @@ use App\Helper\Translate; |
|
|
|
use App\Http\Logic\Bside\BaseLogic;
|
|
|
|
use App\Models\Ai\AiBlog;
|
|
|
|
use App\Models\Ai\AiBlogAuthor;
|
|
|
|
use App\Models\Ai\AiBlogList;
|
|
|
|
use App\Models\Project\AiBlogTask;
|
|
|
|
use App\Models\Project\Project;
|
|
|
|
use App\Models\Project\ProjectAiSetting;
|
|
...
|
...
|
@@ -130,6 +131,7 @@ class AiBlogLogic extends BaseLogic |
|
|
|
//删除路由映射
|
|
|
|
RouteMap::delRoute(RouteMap::SOURCE_AI_BLOG, $id, $this->user['project_id']);
|
|
|
|
$this->model->del(['id'=>$id]);
|
|
|
|
$this->updateBlogList($aiSettingInfo);
|
|
|
|
}
|
|
|
|
}catch (\Exception $e){
|
|
|
|
$this->fail('删除失败');
|
|
...
|
...
|
@@ -137,4 +139,46 @@ class AiBlogLogic extends BaseLogic |
|
|
|
return $this->success();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :更新列表页数据
|
|
|
|
* @name :updateBlogList
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2025/3/5 11:07
|
|
|
|
*/
|
|
|
|
public function updateBlogList($aiSettingInfo){
|
|
|
|
$aiBlogService = new AiBlogService();
|
|
|
|
$aiBlogService->mch_id = $aiSettingInfo['mch_id'];
|
|
|
|
$aiBlogService->key = $aiSettingInfo['key'];
|
|
|
|
$page = 1;
|
|
|
|
$saveData = [];
|
|
|
|
$result = $aiBlogService->getAiBlogList($page,15);
|
|
|
|
if(!isset($result['status']) && $result['status'] != 200){
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
$total_page = $result['data']['total_page'];
|
|
|
|
//组装数据保存
|
|
|
|
$saveData[] = [
|
|
|
|
'route'=>$page,
|
|
|
|
'text'=>$result['data']['section'],
|
|
|
|
];
|
|
|
|
while ($total_page > $page){
|
|
|
|
$page++;
|
|
|
|
$result = $aiBlogService->getAiBlogList($page,15);
|
|
|
|
if(isset($result['status']) && $result['status'] == 200){
|
|
|
|
$saveData[] = [
|
|
|
|
'route'=>$page,
|
|
|
|
'text'=>$result['data']['section'],
|
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$aiBlogListModel = new AiBlogList();
|
|
|
|
if(!empty($saveData)){
|
|
|
|
//写一条路由信息
|
|
|
|
$aiBlogListModel->truncate();
|
|
|
|
$aiBlogListModel->insertAll($saveData);
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|