Commit 8099d283 by 赵增煜

修复bug

parent 55cc7a78
......@@ -8,6 +8,7 @@
use App\Models\PatientModel;
use App\Models\PrescriptionLogModel;
use App\Models\PrescriptionModel;
use App\Models\PharmacyModel;
use App\Models\User;
use App\Models\DosageModel;
use Datetime;
......@@ -27,7 +28,12 @@ public function test()
public function dosageList(Request $request)
{
$authInfo = auth('api')->user();
$dosages = DosageModel::where('pharmacy_id', $authInfo->id)->get();
# 获取药店信息
$pharmacy = PharmacyModel::where('user_id', $authInfo->id)->first();
if (! $pharmacy) {
return $this->failed('您的账号可能在其他设备登录,请重新登录!');
}
$dosages = DosageModel::where('pharmacy_id', $pharmacy->id)->get();
return $this->success($dosages);
}
}
\ No newline at end of file
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