合并分支 'master-server' 到 'master'
Master server 查看合并请求 !1175
正在显示
6 个修改的文件
包含
38 行增加
和
3 行删除
| @@ -170,7 +170,7 @@ class ProjectController extends BaseController | @@ -170,7 +170,7 @@ class ProjectController extends BaseController | ||
| 170 | if (in_array($this->map['type'], [Project::TYPE_ZERO, Project::TYPE_ONE, Project::TYPE_TWO, Project::TYPE_THREE])){ | 170 | if (in_array($this->map['type'], [Project::TYPE_ZERO, Project::TYPE_ONE, Project::TYPE_TWO, Project::TYPE_THREE])){ |
| 171 | $query->where('gl_project.type', $this->map['type']); | 171 | $query->where('gl_project.type', $this->map['type']); |
| 172 | } elseif ($this->map['type'] == 8){ | 172 | } elseif ($this->map['type'] == 8){ |
| 173 | - $query->where('gl_project.online_check_id', null)->where('gl_project.type',Project::TYPE_TWO); | 173 | + $query->where('gl_project_online_check.id', null)->where('gl_project.type',Project::TYPE_TWO); |
| 174 | }else{ | 174 | }else{ |
| 175 | $query->whereIn('gl_project.type', [Project::TYPE_FOUR,Project::TYPE_SIX]); | 175 | $query->whereIn('gl_project.type', [Project::TYPE_FOUR,Project::TYPE_SIX]); |
| 176 | } | 176 | } |
| @@ -65,4 +65,17 @@ class AiBlogController extends BaseController | @@ -65,4 +65,17 @@ class AiBlogController extends BaseController | ||
| 65 | $result = $aiBlogLogic->sendTask(); | 65 | $result = $aiBlogLogic->sendTask(); |
| 66 | $this->response('success',Code::SUCCESS,$result); | 66 | $this->response('success',Code::SUCCESS,$result); |
| 67 | } | 67 | } |
| 68 | + | ||
| 69 | + /** | ||
| 70 | + * @remark :创建作者 | ||
| 71 | + * @name :createAuthor | ||
| 72 | + * @author :lyh | ||
| 73 | + * @method :post | ||
| 74 | + * @time :2025/2/20 10:45 | ||
| 75 | + */ | ||
| 76 | + public function createAuthor(AiBlogLogic $aiBlogLogic){ | ||
| 77 | + //获取当前项目的ai_blog设置 | ||
| 78 | + $result = $aiBlogLogic->createAuthor(); | ||
| 79 | + $this->response('success',Code::SUCCESS,$result); | ||
| 80 | + } | ||
| 68 | } | 81 | } |
| @@ -68,4 +68,24 @@ class AiBlogLogic extends BaseLogic | @@ -68,4 +68,24 @@ class AiBlogLogic extends BaseLogic | ||
| 68 | } | 68 | } |
| 69 | return $this->success(); | 69 | return $this->success(); |
| 70 | } | 70 | } |
| 71 | + | ||
| 72 | + /** | ||
| 73 | + * @remark :创建作者 | ||
| 74 | + * @name :createAuthor | ||
| 75 | + * @author :lyh | ||
| 76 | + * @method :post | ||
| 77 | + * @time :2025/2/20 10:46 | ||
| 78 | + */ | ||
| 79 | + public function createAuthor(){ | ||
| 80 | + $projectAiSettingModel = new ProjectAiSetting(); | ||
| 81 | + $aiSettingInfo = $projectAiSettingModel->read(['project_id'=>$this->user['project_id']]); | ||
| 82 | + if($aiSettingInfo === false){ | ||
| 83 | + $this->fail('请先联系管理员开启Ai博客'); | ||
| 84 | + } | ||
| 85 | + $aiBlogService = new AiBlogService(); | ||
| 86 | + $aiBlogService->mch_id = $aiSettingInfo['mch_id']; | ||
| 87 | + $aiBlogService->key = $aiSettingInfo['key']; | ||
| 88 | + $result = $aiBlogService->createAuthor(); | ||
| 89 | + return $this->success($result); | ||
| 90 | + } | ||
| 71 | } | 91 | } |
| @@ -96,8 +96,9 @@ class AiBlogService | @@ -96,8 +96,9 @@ class AiBlogService | ||
| 96 | $request_url = $this->url.'api/author/create'; | 96 | $request_url = $this->url.'api/author/create'; |
| 97 | $param = [ | 97 | $param = [ |
| 98 | 'mch_id'=>$this->mch_id, | 98 | 'mch_id'=>$this->mch_id, |
| 99 | - 'sign'=>$this->sign, | ||
| 100 | ]; | 99 | ]; |
| 100 | + $this->sign = $this->generateSign($param,$this->key); | ||
| 101 | + $param['sign'] = $this->sign; | ||
| 101 | $result = http_post($request_url,json_encode($param,true)); | 102 | $result = http_post($request_url,json_encode($param,true)); |
| 102 | return $result; | 103 | return $result; |
| 103 | } | 104 | } |
| @@ -156,6 +156,7 @@ Route::middleware(['bloginauth'])->group(function () { | @@ -156,6 +156,7 @@ Route::middleware(['bloginauth'])->group(function () { | ||
| 156 | Route::any('/blog/getAiBlog', [\App\Http\Controllers\Bside\Ai\AiBlogController::class, 'getAiBlog'])->name('ai_blog_getAiBlog'); | 156 | Route::any('/blog/getAiBlog', [\App\Http\Controllers\Bside\Ai\AiBlogController::class, 'getAiBlog'])->name('ai_blog_getAiBlog'); |
| 157 | Route::any('/blog/save', [\App\Http\Controllers\Bside\Ai\AiBlogController::class, 'save'])->name('ai_blog_save'); | 157 | Route::any('/blog/save', [\App\Http\Controllers\Bside\Ai\AiBlogController::class, 'save'])->name('ai_blog_save'); |
| 158 | Route::any('/blog/sendTask', [\App\Http\Controllers\Bside\Ai\AiBlogController::class, 'sendTask'])->name('ai_blog_sendTask'); | 158 | Route::any('/blog/sendTask', [\App\Http\Controllers\Bside\Ai\AiBlogController::class, 'sendTask'])->name('ai_blog_sendTask'); |
| 159 | + Route::any('/blog/createAuthor', [\App\Http\Controllers\Bside\Ai\AiBlogController::class, 'createAuthor'])->name('ai_blog_createAuthor'); | ||
| 159 | Route::any('/product/', [\App\Http\Controllers\Bside\Ai\AiProductController::class, 'save'])->name('ai_product_save'); | 160 | Route::any('/product/', [\App\Http\Controllers\Bside\Ai\AiProductController::class, 'save'])->name('ai_product_save'); |
| 160 | Route::any('/product/productList', [\App\Http\Controllers\Bside\Ai\AiProductController::class, 'productList'])->name('ai_product_productList'); | 161 | Route::any('/product/productList', [\App\Http\Controllers\Bside\Ai\AiProductController::class, 'productList'])->name('ai_product_productList'); |
| 161 | Route::any('/product/productCateList', [\App\Http\Controllers\Bside\Ai\AiProductController::class, 'productCateList'])->name('ai_product_productCateList'); | 162 | Route::any('/product/productCateList', [\App\Http\Controllers\Bside\Ai\AiProductController::class, 'productCateList'])->name('ai_product_productCateList'); |
-
请 注册 或 登录 后发表评论