From b0cf350bbd7a8b9c5ebab0de954e7f9f71b4025c Mon Sep 17 00:00:00 2001 From: qianhy Date: Tue, 14 Mar 2023 16:11:01 +0800 Subject: [PATCH] stock get_month debug params3 --- admin/controllers/items/Stock.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/admin/controllers/items/Stock.php b/admin/controllers/items/Stock.php index c798f1bc..00db78db 100644 --- a/admin/controllers/items/Stock.php +++ b/admin/controllers/items/Stock.php @@ -195,7 +195,7 @@ class Stock extends HD_Controller foreach ($dateMonths as $v2) { $where2 = $where3 = ['biz_id' => $v['id'], 'log_date>=' => $v2['firstDay'], 'log_date<=' => $v2['lastDay']]; $res_log = $this->mdStockLog->select_groupby('s_id', $where2, 'id desc', 0, 0, 'brand_id,s_id'); - $data = ''; + $data_month = ''; if ($res_log) { $str_ids = implode(',', array_unique(array_column($res_log, 'brand_id'))); $map_brand = $this->mdAutoBrand->map('id', 'name', ["id in ({$str_ids})" => null]); @@ -207,13 +207,13 @@ class Stock extends HD_Controller , "count(id) as total"); $count = $res_log2 ? $res_log2[0]['total'] : 0; $title = "{$map_brand[$v3['brand_id']]}-{$map_sery[$v3['s_id']]} {$count}天"; - $data = $data ? $data . ',' . $title : $title; + $data_month = $data_month ? $data_month . ',' . $title : $title; } } if ($params['export'] == 1) { - $months[$v2['name']] = $data; + $months[$v2['name']] = $data_month; } else { - $months[] = ['name' => $v2['name'], 'data' => $data]; + $months[] = ['name' => $v2['name'], 'data' => $data_month]; } } if ($params['export'] == 1) {