From 2bec4ba97c04d2beeb03e0d4eac04de76eec4819 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Fri, 21 Jun 2024 18:05:28 +0800 Subject: [PATCH] =?UTF-8?q?feat(ProductStatisticLogic):=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E5=95=86=E5=93=81=E7=BB=9F=E8=AE=A1=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E5=B9=B6=E4=BC=98=E5=8C=96=E6=9F=A5=E8=AF=A2=E6=80=A7=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/logic/statistic/ProductStatisticLogic.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/admin/logic/statistic/ProductStatisticLogic.php b/app/admin/logic/statistic/ProductStatisticLogic.php index b1ddd460f..948538b9e 100644 --- a/app/admin/logic/statistic/ProductStatisticLogic.php +++ b/app/admin/logic/statistic/ProductStatisticLogic.php @@ -32,7 +32,7 @@ class ProductStatisticLogic extends BaseLogic 'SUM(collect_num) as collect', 'ROUND((COUNT(distinct(pay_uid))-1)/COUNT(distinct(uid)),2) as changes', 'COUNT(distinct(pay_uid))-1 as repeats' - ])->group('product_id')->order('pay' , ' desc')->limit(20)->select()->toArray(); + ])->group('product_id')->order('pay'.' desc')->limit(20)->select()->toArray(); foreach ($list as $key => &$item) { $find=StoreProduct::where('id',$item['product_id'])->field('store_name,image')->find(); $item['store_name']=$find['store_name']; @@ -45,6 +45,6 @@ class ProductStatisticLogic extends BaseLogic $item['repeats'] = bcdiv(count(StoreProductLog::where($where)->where('type', 'pay')->where('product_id', $item['product_id'])->field('count(pay_uid) as p')->group('pay_uid')->having('p>1')->select()), $item['repeats'], 2); } } - return array_merge($list); + return $list; } }