liyinglin 2 years ago
parent ad6aaa2436
commit 01e4ab0598

@ -52,7 +52,7 @@ class ProductForm extends Form
'label' => false
]
]);
// $this->add("factor_id", Field::SELECT, ["label" => "统计价格因素"]);
$this->add("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"]]

@ -156,7 +156,6 @@ class CommonController extends Controller
{
try {
$data = (new CommonModel())->setTable($this->model->getTable())->filterRequestColumns($request, ["id"]);
dd($data);
$model = $this->model->find($id ?: $request->id);
$model->update($data);
$this->updated($model);

@ -91,9 +91,9 @@ class ProductController extends CommonController
"model" => $vo
]);
$form->add("_previous", "hidden", ["value" => (url()->previous())]);
// $form->modify("factor_id", 'select', ["label" => "统计价格因素",
// "choices" => (new Factor())->where('product_id', $request->id)->get()->pluck("name", "id")->toArray()]
// );
$form->modify("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"));
}

Loading…
Cancel
Save