From 4db65f52031b083b92fba497ad81d8df40e81569 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=99=AF=E7=AB=8B?= Date: Sun, 8 May 2022 19:37:48 +0800 Subject: [PATCH] Update UserRebateService.php --- app/data/service/UserRebateService.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/data/service/UserRebateService.php b/app/data/service/UserRebateService.php index 2c19e54ed..f4114dd48 100644 --- a/app/data/service/UserRebateService.php +++ b/app/data/service/UserRebateService.php @@ -20,7 +20,7 @@ class UserRebateService extends Service * @param integer $uuid * @return array [total, count, lock] */ - public function amount(int $uuid): array + public static function amount(int $uuid): array { if ($uuid > 0) { $count = DataUserTransfer::mk()->whereRaw("uuid='{$uuid}' and status>0")->sum('amount'); @@ -43,10 +43,10 @@ class UserRebateService extends Service * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException */ - public function confirm(string $orderNo): array + public static function confirm(string $orderNo): array { $map = [['status', '>=', 4], ['order_no', '=', $orderNo]]; - $order = ShopOrder::mk()->where($map)->find(); + $order = ShopOrder::mk()->where($map)->findOrEmpty()->toArray(); if (empty($order)) return [0, '需处理的订单状态异常!']; $map = [['status', '=', 0], ['order_no', 'like', "{$orderNo}%"]]; DataUserRebate::mk()->where($map)->update(['status' => 1]);