liyinglin 2 years ago
parent 92ffb08e33
commit b95256c23e

@ -52,7 +52,7 @@ class ProductForm extends Form
'label' => false
]
]);
$this->add("factor_item_ids[]", Field::SELECT, ["label" => "统计价格因素", "rules" => "required", "attr" => ["multiple" => true, "data-plugin" => "select2"]]);
$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"]]

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

@ -404,8 +404,18 @@ class StatisticsController extends CommonController
$query->whereIn('id', $areaId);
}
})->paginate(10);
foreach ($data as $item) {
// 获取所有床位id
$bedIds = Bed::where('area_id', $item->id)->pluck('id');
$order = Orders::whereIn('bed_id', $bedIds)->where('status', 100)->get();
}
dd($data->toArray());
return view($this->bladePath . ".huli", compact("data"));
}
}

@ -14,7 +14,7 @@ class UpdateProductTable extends Migration
public function up()
{
Schema::table("product", function (Blueprint $table) {
$table->json("factor_item_ids")->nullable();
$table->integer("factor_id")->nullable();
});
}

Loading…
Cancel
Save