From 9ed3540e19ef06c12123290d69392cb764771b88 Mon Sep 17 00:00:00 2001 From: liyinglin Date: Fri, 5 Jan 2024 15:00:04 +0800 Subject: [PATCH] 1 --- app/Forms/ProductForm.php | 2 +- app/Http/Controllers/Admin/ProductController.php | 2 +- app/Http/Controllers/Admin/StatisticsController.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Forms/ProductForm.php b/app/Forms/ProductForm.php index 44a9fbe..ae0b918 100755 --- a/app/Forms/ProductForm.php +++ b/app/Forms/ProductForm.php @@ -52,7 +52,7 @@ class ProductForm extends Form 'label' => false ] ]); - $this->add("factor_id", Field::SELECT, ["label" => "统计价格因素"]); + $this->add("statistic_factor_id", Field::SELECT, ["label" => "统计价格因素"]); $this->add('buttons', 'buttongroup', ["splitted" => true, "buttons" => [ ["label" => "保存", "attr" => ["class" => "btn btn-primary mr-1", "type" => "submit"]], ["label" => "返回", "attr" => ["class" => "btn btn-light btn-back", "type" => "button"]] diff --git a/app/Http/Controllers/Admin/ProductController.php b/app/Http/Controllers/Admin/ProductController.php index 337e38d..019c068 100755 --- a/app/Http/Controllers/Admin/ProductController.php +++ b/app/Http/Controllers/Admin/ProductController.php @@ -91,7 +91,7 @@ class ProductController extends CommonController "model" => $vo ]); $form->add("_previous", "hidden", ["value" => (url()->previous())]); - $form->modify("factor_id", 'select', ["label" => "统计价格因素", + $form->modify("statistic_factor_id", 'select', ["label" => "统计价格因素", "choices" => (new Factor())->where('product_id', $request->id)->get()->pluck("name", "id")->toArray()] ); return view($this->bladePath . ".create", compact("form", "project", "vo")); diff --git a/app/Http/Controllers/Admin/StatisticsController.php b/app/Http/Controllers/Admin/StatisticsController.php index 3f7205b..ea3d7f9 100755 --- a/app/Http/Controllers/Admin/StatisticsController.php +++ b/app/Http/Controllers/Admin/StatisticsController.php @@ -409,7 +409,7 @@ class StatisticsController extends CommonController $product = Product::where('project_id', $project_id)->first(); $productItem = ProductItems::where('product_id', $product->id)->get(); - $factor = FactorItems::where('factor_id', $product->factor_id)->get(); + $factor = FactorItems::where('factor_id', $product->statistic_factor_id)->get(); foreach ($data as $item) { // 获取所有床位id