|
@@ -114,6 +114,39 @@ class EvaluateController extends Curd
|
|
|
return $items;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * @Desc 评价管理顶部统计
|
|
|
+ * @Author Gorden
|
|
|
+ * @Date 2024/11/1 13:41
|
|
|
+ *
|
|
|
+ * @param Request $request
|
|
|
+ * @return Response
|
|
|
+ */
|
|
|
+ public function statistics(Request $request)
|
|
|
+ {
|
|
|
+ $total = GoodsEvaluate::count('goods_evaluate_id');
|
|
|
+ $pendingTotal = GoodsEvaluate::where('goods_evaluate_status', 'PENDING')->count('goods_evaluate_id');
|
|
|
+ $activedTotal = GoodsEvaluate::where('goods_evaluate_status', 'ACTIVED')->count('goods_evaluate_id');
|
|
|
+ $disabledTotal = GoodsEvaluate::where('goods_evaluate_status', 'DELETED')->count('goods_evaluate_id');
|
|
|
+ $oneScoreTotal = GoodsEvaluate::where('goods_evaluate_value', 1)->count('goods_evaluate_id');
|
|
|
+ $twoScoretotal = GoodsEvaluate::where('goods_evaluate_value', 2)->count('goods_evaluate_id');
|
|
|
+ $threeScoretotal = GoodsEvaluate::where('goods_evaluate_value', 3)->count('goods_evaluate_id');
|
|
|
+ $fourScoretotal = GoodsEvaluate::where('goods_evaluate_value', 4)->count('goods_evaluate_id');
|
|
|
+ $fiveScoretotal = GoodsEvaluate::where('goods_evaluate_value', 5)->count('goods_evaluate_id');
|
|
|
+
|
|
|
+ return json_success('success', [
|
|
|
+ 'total' => $total,
|
|
|
+ 'pendingTotal' => $pendingTotal,
|
|
|
+ 'activedTotal' => $activedTotal,
|
|
|
+ 'disabledTotal' => $disabledTotal,
|
|
|
+ 'oneScoreTotal' => $oneScoreTotal,
|
|
|
+ 'twoScoretotal' => $twoScoretotal,
|
|
|
+ 'threeScoretotal' => $threeScoretotal,
|
|
|
+ 'fourScoretotal' => $fourScoretotal,
|
|
|
+ 'fiveScoretotal' => $fiveScoretotal,
|
|
|
+ ]);
|
|
|
+ }
|
|
|
+
|
|
|
public function info(Request $request): Response
|
|
|
{
|
|
|
$goodsEvaluateId = $request->get('goods_evaluate_id', '');
|