From bbb7f829870f176f9755b5871b336229269c9d5f Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Thu, 24 Aug 2023 16:09:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BF=AE=E5=A4=8D=E9=80=80?= =?UTF-8?q?=E6=AC=BE=E8=AE=A2=E5=8D=95=E6=95=B0=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/dao/system/merchant/FinancialRecordDao.php | 5 ++--- .../system/merchant/FinancialRecordRepository.php | 5 +++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/common/dao/system/merchant/FinancialRecordDao.php b/app/common/dao/system/merchant/FinancialRecordDao.php index 44d2d7c9..48553016 100644 --- a/app/common/dao/system/merchant/FinancialRecordDao.php +++ b/app/common/dao/system/merchant/FinancialRecordDao.php @@ -112,9 +112,8 @@ class FinancialRecordDao extends BaseDao } else { $query->whereMonth('create_time',$date); } - - $count = $query->group('order_id')->count(); - $number = $query->sum('number'); + $count = $query->group('order_id')->where('number', '<>', 0)->count(); + $number = $query->where('number', '<>', 0)->sum('number'); return [$count,$number]; } diff --git a/app/common/repositories/system/merchant/FinancialRecordRepository.php b/app/common/repositories/system/merchant/FinancialRecordRepository.php index 0b54542e..e5fc2bc4 100644 --- a/app/common/repositories/system/merchant/FinancialRecordRepository.php +++ b/app/common/repositories/system/merchant/FinancialRecordRepository.php @@ -465,6 +465,7 @@ class FinancialRecordRepository extends BaseRepository $date = ($type == 1) ? date('Y-m-d', $date_) : date('Y-m', $date_); $income = $this->countIncome($type, $where, $date,$merchant); $expend = $this->countExpend($type, $where, $date,$merchant); + $data['e'] = $expend; $charge = bcsub($income['number'], $expend['number'], 2); $data['date'] = $date; @@ -634,7 +635,7 @@ class FinancialRecordRepository extends BaseRepository $financialType = ['brokerage_one', 'brokerage_two']; [$data['count_brokerage'], $data['number_brokerage']] = $this->dao->getDataByType($type, $where, $date, $financialType); - // 退回 手续费 + // 退回手续费 $financialType = ['refund_charge']; [$data['count_charge'], $data['number_charge']] = $this->dao->getDataByType($type, $where, $date, $financialType); @@ -665,7 +666,7 @@ class FinancialRecordRepository extends BaseRepository $commission=['commission_to_town','commission_to_village','commission_to_service_team','commission_to_cloud_warehouse','commission_to_entry_merchant']; } if ($where['is_mer']) { //商户的 - //退回 收入 + //退回收入 $financialType = ['refund_order']; [$data['count_refund'], $data['number_refund']] = $this->dao->getDataByType($type, $where, $date, $financialType);