liyinglin 2 years ago
parent 01e4ab0598
commit 9ed3540e19

@ -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"]]

@ -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"));

@ -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

Loading…
Cancel
Save