作者 李宇航

合并分支 'lyh-server' 到 'master'

gx导入项目脚本



查看合并请求 !2114
@@ -335,4 +335,32 @@ class KeywordController extends BaseController @@ -335,4 +335,32 @@ class KeywordController extends BaseController
335 $this->response('success',Code::SUCCESS,$data); 335 $this->response('success',Code::SUCCESS,$data);
336 } 336 }
337 337
  338 + /**
  339 + * @remark :获取评论
  340 + * @name :getComment
  341 + * @author :lyh
  342 + * @method :post
  343 + * @time :2025/6/9 11:45
  344 + */
  345 + public function getComment(KeywordLogic $logic){
  346 + $data = $logic->getComment($this->map,$this->page,$this->row);
  347 + $this->response('success',Code::SUCCESS,$data);
  348 + }
  349 +
  350 + /**
  351 + * @remark :删除评论
  352 + * @name :getComment
  353 + * @author :lyh
  354 + * @method :post
  355 + * @time :2025/6/9 11:45
  356 + */
  357 + public function delComment(KeywordLogic $logic){
  358 + $this->request->validate([
  359 + 'id'=>'required',
  360 + ],[
  361 + 'id.required' => '主键不能为空',
  362 + ]);
  363 + $data = $logic->delComment();
  364 + $this->response('success',Code::SUCCESS,$data);
  365 + }
338 } 366 }
@@ -390,4 +390,35 @@ class KeywordLogic extends BaseLogic @@ -390,4 +390,35 @@ class KeywordLogic extends BaseLogic
390 $keywordCommonModel->insertAll($data); 390 $keywordCommonModel->insertAll($data);
391 return $this->success($data); 391 return $this->success($data);
392 } 392 }
  393 +
  394 + /**
  395 + * @remark :获取评论
  396 + * @name :getComment
  397 + * @author :lyh
  398 + * @method :post
  399 + * @time :2025/6/9 11:46
  400 + */
  401 + public function getComment($map,$page,$row){
  402 + $keywordCommonModel = new AggregateKeywordComment();
  403 + $map['project_id'] = $this->user['project_id'];
  404 + $lists = $keywordCommonModel->lists($map,$page,$row);
  405 + return $this->success($lists);
  406 + }
  407 +
  408 + /**
  409 + * @remark :删除评论
  410 + * @name :delComment
  411 + * @author :lyh
  412 + * @method :post
  413 + * @time :2025/6/9 11:48
  414 + */
  415 + public function delComment(){
  416 + $keywordCommonModel = new AggregateKeywordComment();
  417 + if($this->param['id'] = 0){
  418 + $keywordCommonModel->del(['project_id'=>$this->param['project_id']]);
  419 + }else{
  420 + $keywordCommonModel->del(['id'=>$this->param['id']]);
  421 + }
  422 + return $this->success();
  423 + }
393 } 424 }
@@ -328,6 +328,8 @@ Route::middleware(['bloginauth'])->group(function () { @@ -328,6 +328,8 @@ Route::middleware(['bloginauth'])->group(function () {
328 Route::any('keyword/batchKeywordFiled', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'batchKeywordFiled'])->name('product_keyword_batchKeywordFiled'); 328 Route::any('keyword/batchKeywordFiled', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'batchKeywordFiled'])->name('product_keyword_batchKeywordFiled');
329 Route::any('keyword/delRelatedProductId', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'delRelatedProductId'])->name('product_keyword_delRelatedProductId'); 329 Route::any('keyword/delRelatedProductId', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'delRelatedProductId'])->name('product_keyword_delRelatedProductId');
330 Route::any('keyword/sendComment', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'sendComment'])->name('product_keyword_sendComment'); 330 Route::any('keyword/sendComment', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'sendComment'])->name('product_keyword_sendComment');
  331 + Route::any('keyword/getComment', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'getComment'])->name('product_keyword_getComment');
  332 + Route::any('keyword/delComment', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'delComment'])->name('product_keyword_delComment');
331 //产品参数 333 //产品参数
332 Route::get('attr', [\App\Http\Controllers\Bside\Product\AttrController::class, 'index'])->name('product_attr'); 334 Route::get('attr', [\App\Http\Controllers\Bside\Product\AttrController::class, 'index'])->name('product_attr');
333 Route::get('attr/info', [\App\Http\Controllers\Bside\Product\AttrController::class, 'info'])->name('product_attr_info'); 335 Route::get('attr/info', [\App\Http\Controllers\Bside\Product\AttrController::class, 'info'])->name('product_attr_info');