From 146e280418b3eb04f743f7aca85e0c9e2cd76b1f Mon Sep 17 00:00:00 2001 From: zpc Date: Sat, 19 Apr 2025 18:40:10 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.env b/.env index d30629e..a15c551 100644 --- a/.env +++ b/.env @@ -6,9 +6,9 @@ DEFAULT_TIMEZONE = Asia/Shanghai [DATABASE] TYPE = mysql HOSTNAME = 127.0.0.1 -DATABASE = youda_test -USERNAME = youda_test -PASSWORD = youda_test +DATABASE = youda +USERNAME = youda +PASSWORD = youda HOSTPORT = 3306 CHARSET = utf8 DEBUG = false From a5b6906dad14cb74ec7a13b0664329732bc4ca0f Mon Sep 17 00:00:00 2001 From: youda Date: Sun, 20 Apr 2025 12:01:00 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E7=9A=84=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/Config.php | 2 +- app/common/service/RankService.php | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/app/api/controller/Config.php b/app/api/controller/Config.php index 6ffe8c2..5010051 100755 --- a/app/api/controller/Config.php +++ b/app/api/controller/Config.php @@ -26,7 +26,7 @@ class Config extends Base return $this->renderSuccess('获取成功', [ 'good_type' => $goodsTypeList, 'app_setting' => $app_setting, - 'version' => '103' + 'version' => '104' ]); } diff --git a/app/common/service/RankService.php b/app/common/service/RankService.php index 7a11174..39953ea 100644 --- a/app/common/service/RankService.php +++ b/app/common/service/RankService.php @@ -220,6 +220,9 @@ class RankService if ($endTime > 0) { $where[] = ['addtime', '<=', $endTime]; } + if($limit==10){ + $limit=200; + } $list = OrderListRecovery::where($where) ->field('user_id, sum(money) as use_money') ->group('user_id') @@ -247,7 +250,7 @@ class RankService 'user_id' => $item['user_id'], 'nickname' => $userInfo['nickname'], 'headimg' => imageUrl($userInfo['headimg']), - 'value' => $item['use_money']*100, + 'value' => intval($item['use_money'] * 100), 'unit' => '达达卷' ]; } @@ -365,7 +368,7 @@ class RankService $outputMoneyWhere[] = ['addtime', '<=', $endTime]; } $outputMoneyWhere[] = ['user_id', '=', $userId]; - + $outputMoney = Db::name('order_list') ->where($outputMoneyWhere) ->sum('goodslist_money'); @@ -379,17 +382,17 @@ class RankService $dadaMoneyWhere[] = ['addtime', '<=', $endTime]; } $dadaMoneyWhere[] = ['user_id', '=', $userId]; - + $dadaMoney = Db::name('order_list_recovery') ->where($dadaMoneyWhere) ->sum('money'); - + // 如果dadaMoney为null,设置为0 $dadaMoney = $dadaMoney ?: 0; // 计算亏损金额:(出货金额-(微信消费金额+达达卷金额)) $lossMoney = $outputMoney - ($money + $dadaMoney); - + // 计算亏损率 $totalConsume = $money + $dadaMoney; $lossRate = $totalConsume > 0 ? round(($lossMoney / $totalConsume) * 100, 2) : 0; @@ -423,7 +426,7 @@ class RankService if ($userInfo) { // 取亏损金额的绝对值来显示 $absoluteLossMoney = abs($item['loss_money']); - + $result[] = [ 'rank' => $offset + $index + 1, 'user_id' => $item['user_id'], From b4af8c3116b7274af871a93c34667bbe19b8bcb3 Mon Sep 17 00:00:00 2001 From: youda Date: Mon, 21 Apr 2025 17:01:21 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/Config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/api/controller/Config.php b/app/api/controller/Config.php index 5010051..98beefa 100755 --- a/app/api/controller/Config.php +++ b/app/api/controller/Config.php @@ -26,7 +26,7 @@ class Config extends Base return $this->renderSuccess('获取成功', [ 'good_type' => $goodsTypeList, 'app_setting' => $app_setting, - 'version' => '104' + 'version' => '105' ]); }