weizong song 2 years ago
parent d054dfc009
commit 84608b0e05

@ -187,18 +187,12 @@ class StatisticsController extends CommonController
DB::enableQueryLog();
//采用指定订单号
$model = OrderItems::whereHas("order", function ($query) {
$query->whereIn("serial", [
"20210910000003",
"20210914000006",
"20210826000004",
"20210909000022",
"20210903000007",
"20210918000013",
"20210906000015"
]);
})->where("service_date", ">=", "2021-09-01");
$query->whereIn("serial", ["20240101000016", "20240103000044", "20240103000055", "20240103000068", "20240104000010", "20240104000011", "20240104000012", "20240104000035", "20240104000040", "20240105000009", "20240105000042", "20240105000049", "20240105000051", "20240105000063", "20240105000064", "20231212000051", "20240104000023", "20240104000033", "20240104000036", "20240104000049", "20240104000059", "20240104000060", "20240105000043", "20240105000045", "20240105000048", "20240105000065", "20240105000066", "20240101000024", "20240104000007", "20240104000030", "20240104000034", "20240104000044", "20240104000065"]);
})->where("factors", "not like", "%陪护标准%");
//采用指定订单号结束
dd($model->count());
if ($request->last_id) {
$model = $model->where("id", ">", $request->last_id);
}
@ -211,17 +205,7 @@ class StatisticsController extends CommonController
DB::beginTransaction();
try {
foreach ($orderItems as $orderItem) {
$factors = json_decode($orderItem->factors);
foreach ($factors as $factor) {
$current_factor = FactorItems::find(3);
$factor->fee = $current_factor->fee;
$factor->fee_percent = $current_factor->fee_percent;
$factor->factor_name = $current_factor->name;
}
$orderItem->update([
"factors" => json_encode($factors)
]);
}
DB::commit();
return $this->success("处理成功一批,正在跳转到下一批!", url($this->urlPrefix . "/salary/sync-order-items?month={$request->month}&last_id=" . $orderItems->last()->id));

Loading…
Cancel
Save