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]);