From 9850225b111a7495a8d552923552d8736f596160 Mon Sep 17 00:00:00 2001 From: weizong song Date: Tue, 2 May 2023 14:46:18 +0800 Subject: [PATCH] up --- app/Http/Controllers/Admin/StatisticsController.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/app/Http/Controllers/Admin/StatisticsController.php b/app/Http/Controllers/Admin/StatisticsController.php index 38cd863..03cf23f 100755 --- a/app/Http/Controllers/Admin/StatisticsController.php +++ b/app/Http/Controllers/Admin/StatisticsController.php @@ -69,7 +69,9 @@ class StatisticsController extends CommonController $months = $this->_getMonths(); DB::enableQueryLog(); - $paramedics = (new Paramedic())->ofProject($project_id)->with(["orderItems" => function ($query) use ($month) { + $paramedics = (new Paramedic())->where(function ($query) use ($project_id, $month) { + $query->where("project_id", $project_id); + })->with(["orderItems" => function ($query) use ($month) { $query->whereRaw("(DATE_FORMAT(`service_date`,'%Y-%m') = '{$month}' or DATE_FORMAT(`paid_at`,'%Y-%m') = '{$month}')") ->where("total", ">", 0) ->whereHas("order") @@ -158,8 +160,8 @@ class StatisticsController extends CommonController { DB::enableQueryLog(); //采用指定订单号 - $model = OrderItems::whereHas("order", function($query) { - $query->whereIn("serial",[ + $model = OrderItems::whereHas("order", function ($query) { + $query->whereIn("serial", [ "20210910000003", "20210914000006", "20210826000004", @@ -168,7 +170,7 @@ class StatisticsController extends CommonController "20210918000013", "20210906000015" ]); - })->where("service_date",">=","2021-09-01"); + })->where("service_date", ">=", "2021-09-01"); //采用指定订单号结束 if ($request->last_id) { @@ -317,7 +319,8 @@ class StatisticsController extends CommonController return $this->success("处理完毕" . $balances->count() . "条数据,正在进入下一批数据。", url($this->urlPrefix . "/finance/fix-balance-order-id?timer=" . time())); } - public function manualQueryRecharge($id) { + public function manualQueryRecharge($id) + { $recharge = Recharge::find($id); $res = (new AlipayF2F())->manualQuery($recharge); dd($res);