添加:商品评论添加审核功能

This commit is contained in:
wuhui_zzw 2023-11-16 16:21:37 +08:00
parent 381dd69715
commit dbd56251a9
5 changed files with 39 additions and 2 deletions

View File

@ -55,6 +55,8 @@ class ProductReplyDao extends BaseDao
$query->where('product_type', 'product_type');
})->when(isset($where['is_del']) && $where['is_del'] !== '', function ($query) use ($where) {
$query->where('is_del', $where['is_del']);
})->when(isset($where['status']) && $where['status'] !== '', function ($query) use ($where) {
$query->where('status', $where['status']);
})->order('sort DESC');
}
@ -65,6 +67,9 @@ class ProductReplyDao extends BaseDao
->when(isset($where['is_reply']) && $where['is_reply'] !== '', function ($query) use ($where) {
$query->where('A.is_reply', $where['is_reply']);
})
->when(isset($where['status']) && $where['status'] !== '', function ($query) use ($where) {
$query->where('A.status', $where['status']);
})
->when(isset($where['nickname']) && $where['nickname'] !== '', function ($query) use ($where) {
$query->whereLike('A.nickname', "%{$where['nickname']}%");
})
@ -85,7 +90,7 @@ class ProductReplyDao extends BaseDao
})
->order('A.sort DESC, A.create_time DESC')
->where('A.is_del', 0)
->field('A.reply_id,A.is_reply,A.uid,A.product_score,A.service_score,A.postage_score,A.comment,A.pics,A.create_time,A.merchant_reply_content,A.nickname,A.avatar,B.store_name,B.image,B.product_id,A.sort');
->field('A.reply_id,A.status,A.is_reply,A.uid,A.product_score,A.service_score,A.postage_score,A.comment,A.pics,A.create_time,A.merchant_reply_content,A.nickname,A.avatar,B.store_name,B.image,B.product_id,A.sort');
}
/**

View File

@ -52,7 +52,7 @@ class StoreProductReply extends BaseController
public function lst()
{
[$page, $limit] = $this->getPage();
$where = $this->request->params(['keyword', 'nickname', 'is_reply', 'date', 'product_id']);
$where = $this->request->params(['keyword', 'nickname', 'is_reply', 'date', 'product_id', 'status']);
$where['mer_id'] = $this->request->merId() ?: '';
return \app('json')->success($this->repository->getList($where, $page, $limit));
}
@ -151,4 +151,28 @@ class StoreProductReply extends BaseController
$this->repository->update($id, $data);
return app('json')->success('修改成功');
}
/**
* Common: 评论审核
* Author: wu-hui
* Time: 2023/11/16 16:09
* @param $replyId
* @return mixed
*/
public function examine($replyId){
try{
$this->repository->update($replyId,[
'status' => 1
]);
return app('json')->success('审核成功');
}catch(\Exception $e){
return app('json')->error($e->getMessage());
}
}
}

View File

@ -42,6 +42,8 @@ class StoreReply extends BaseController
$where['type'] = $this->request->param('type');
$where['product_id'] = $id;
$where['status'] = 1;// 仅显示审核通过的评论
return app('json')->success($this->repository->getApiList($where,$page, $limit));
}

View File

@ -234,6 +234,9 @@ Route::group(function () {
Route::delete('delete/:id', '/delete')->name('systemProductReplyDelete')->option([
'_alias' => '删除',
]);
Route::get('examine/:replyId', '/examine')->name('systemProductReplyExamine')->option([
'_alias' => '审核',
]);
})->prefix('admin.store.StoreProductReply')->option([
'_path' => '/product/comment',
'_auth' => true,

View File

@ -252,6 +252,9 @@ Route::group(function () {
Route::post('reply/:id', '/reply')->name('merchantProductReplyReply')->option([
'_alias' => '回复',
]);
Route::get('examine/:replyId', '/examine')->name('merchantProductReplyExamine')->option([
'_alias' => '审核',
]);
})->prefix('admin.store.StoreProductReply')->option([
'_path' => '/product/reviews',
'_auth' => true,