作者 lyh

gx导入项目脚本

... ... @@ -335,4 +335,32 @@ class KeywordController extends BaseController
$this->response('success',Code::SUCCESS,$data);
}
/**
* @remark :获取评论
* @name :getComment
* @author :lyh
* @method :post
* @time :2025/6/9 11:45
*/
public function getComment(KeywordLogic $logic){
$data = $logic->getComment($this->map,$this->page,$this->row);
$this->response('success',Code::SUCCESS,$data);
}
/**
* @remark :删除评论
* @name :getComment
* @author :lyh
* @method :post
* @time :2025/6/9 11:45
*/
public function delComment(KeywordLogic $logic){
$this->request->validate([
'id'=>'required',
],[
'id.required' => '主键不能为空',
]);
$data = $logic->delComment();
$this->response('success',Code::SUCCESS,$data);
}
}
... ...
... ... @@ -390,4 +390,35 @@ class KeywordLogic extends BaseLogic
$keywordCommonModel->insertAll($data);
return $this->success($data);
}
/**
* @remark :获取评论
* @name :getComment
* @author :lyh
* @method :post
* @time :2025/6/9 11:46
*/
public function getComment($map,$page,$row){
$keywordCommonModel = new AggregateKeywordComment();
$map['project_id'] = $this->user['project_id'];
$lists = $keywordCommonModel->lists($map,$page,$row);
return $this->success($lists);
}
/**
* @remark :删除评论
* @name :delComment
* @author :lyh
* @method :post
* @time :2025/6/9 11:48
*/
public function delComment(){
$keywordCommonModel = new AggregateKeywordComment();
if($this->param['id'] = 0){
$keywordCommonModel->del(['project_id'=>$this->param['project_id']]);
}else{
$keywordCommonModel->del(['id'=>$this->param['id']]);
}
return $this->success();
}
}
... ...
... ... @@ -328,6 +328,8 @@ Route::middleware(['bloginauth'])->group(function () {
Route::any('keyword/batchKeywordFiled', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'batchKeywordFiled'])->name('product_keyword_batchKeywordFiled');
Route::any('keyword/delRelatedProductId', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'delRelatedProductId'])->name('product_keyword_delRelatedProductId');
Route::any('keyword/sendComment', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'sendComment'])->name('product_keyword_sendComment');
Route::any('keyword/getComment', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'getComment'])->name('product_keyword_getComment');
Route::any('keyword/delComment', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'delComment'])->name('product_keyword_delComment');
//产品参数
Route::get('attr', [\App\Http\Controllers\Bside\Product\AttrController::class, 'index'])->name('product_attr');
Route::get('attr/info', [\App\Http\Controllers\Bside\Product\AttrController::class, 'info'])->name('product_attr_info');
... ...