From 1fb3f295ad34010c81cb2813607157d24b31a660 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Fri, 21 Jun 2024 14:51:35 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0StoreProduct=E6=A8=A1?= =?UTF-8?q?=E5=9E=8B=E4=BB=A5=E8=8E=B7=E5=8F=96=E5=95=86=E5=93=81=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/logic/statistic/ProductStatisticLogic.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/admin/logic/statistic/ProductStatisticLogic.php b/app/admin/logic/statistic/ProductStatisticLogic.php index a87f99710..b7261ab69 100644 --- a/app/admin/logic/statistic/ProductStatisticLogic.php +++ b/app/admin/logic/statistic/ProductStatisticLogic.php @@ -3,6 +3,7 @@ namespace app\admin\logic\statistic; use app\common\logic\BaseLogic; +use app\common\model\store_product\StoreProduct; use app\common\model\store_product_log\StoreProductLog; /** @@ -16,7 +17,7 @@ class ProductStatisticLogic extends BaseLogic { $time = explode('-', $where['create_time']); $time = [strtotime($time[0]), strtotime($time[1])]; - $list = StoreProductLog::whereBetweenTime('create_time',$time[0],$time[1])->with('store') + $list = StoreProductLog::whereBetweenTime('create_time',$time[0],$time[1]) ->field([ 'store_id', 'product_id', @@ -36,6 +37,9 @@ class ProductStatisticLogic extends BaseLogic if (!$item['store_name']) { unset($list[$key]); } + $find=StoreProduct::where('id',$item['product_id'])->field('store_name,image')->find(); + $item['store_name']=$find['store_name']; + $item['image']=$find['image']; if ($item['profit'] == null) $item['profit'] = 0; if ($item['changes'] == null) $item['changes'] = 0; if ($item['repeats'] == null) {