From f6de7c1f647a6c58ec6a3dfdae5fd75d201f20ee Mon Sep 17 00:00:00 2001 From: evoxwht <442384644@qq.com> Date: Wed, 29 Mar 2023 10:57:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=A7=92=E6=9D=80=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../adminapi/controller/v1/marketing/StoreSeckill.php | 4 ++++ .../activity/seckill/StoreSeckillServices.php | 11 +++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/crmeb/app/adminapi/controller/v1/marketing/StoreSeckill.php b/crmeb/app/adminapi/controller/v1/marketing/StoreSeckill.php index 79f08398e..6d359ec66 100644 --- a/crmeb/app/adminapi/controller/v1/marketing/StoreSeckill.php +++ b/crmeb/app/adminapi/controller/v1/marketing/StoreSeckill.php @@ -135,7 +135,11 @@ class StoreSeckill extends AuthController /** * 秒杀统计 + * @param $id * @return mixed + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException */ public function seckillStatistics($id) { diff --git a/crmeb/app/services/activity/seckill/StoreSeckillServices.php b/crmeb/app/services/activity/seckill/StoreSeckillServices.php index cdd95380c..1bcf9c782 100644 --- a/crmeb/app/services/activity/seckill/StoreSeckillServices.php +++ b/crmeb/app/services/activity/seckill/StoreSeckillServices.php @@ -716,6 +716,9 @@ class StoreSeckillServices extends BaseServices * @param $id * @param string $field * @return array|false|\PDOStatement|string|\think\Model + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException */ public function getValidProduct($id, $field = '*') { @@ -724,14 +727,18 @@ class StoreSeckillServices extends BaseServices /** * 秒杀统计 + * @param $id * @return array + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException */ public function seckillStatistics($id) { /** @var StoreOrderServices $orderServices */ $orderServices = app()->make(StoreOrderServices::class); - $pay_count = $orderServices->getDistinctCount([['seckill_id', '=', $id], ['paid', '=', 1]], 'uid', false); - $order_count = $orderServices->getDistinctCount([['seckill_id', '=', $id]], 'uid', false); + $pay_count = $orderServices->getDistinctCount([['seckill_id', '=', $id], ['paid', '=', 1], ['refund_type', 'in', [0, 3]]], 'uid', false); + $order_count = $orderServices->getDistinctCount([['seckill_id', '=', $id], ['refund_type', 'in', [0, 3]]], 'uid', false); $all_price = $orderServices->sum([['seckill_id', '=', $id], ['refund_type', 'in', [0, 3]], ['paid', '=', 1]], 'pay_price'); $seckillInfo = $this->dao->get($id); $pay_rate = $seckillInfo['quota'] . '/' . $seckillInfo['quota_show'];