Commit 98bfbd85 by lujunyi

导入药品bug

parent d99c8b38
...@@ -34,11 +34,12 @@ public function handle(array $input) ...@@ -34,11 +34,12 @@ public function handle(array $input)
if (! $ids) { if (! $ids) {
return $this->response()->error('请选择药品')->refresh(); return $this->response()->error('请选择药品')->refresh();
} }
$pharmacyId = Admin::user()->pharmacy_id;
foreach ($ids as $id) { foreach ($ids as $id) {
$drug = DrugModel::find($id); $drug = DrugModel::find($id);
$where = ['drug_id' => $id]; $where = ['drug_id' => $id, 'pharmacy_id' => $pharmacyId];
$data = [ $data = [
'pharmacy_id' => Admin::user()->pharmacy_id, 'pharmacy_id' => $pharmacyId,
'drug_id' => $id, 'drug_id' => $id,
'unit' => $drug->unit, 'unit' => $drug->unit,
]; ];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment