Commit 207978d4 by lujunyi

格式化

parent 1845a209
......@@ -4,9 +4,9 @@
use App\Http\Controllers\BaseApiController;
use App\Models\DrugModel;
use App\Models\User;
use App\Models\PharmacyDrugModel;
use App\Models\PharmacyModel;
use App\Models\User;
use Illuminate\Http\Request;
// 药品控制器
......@@ -33,9 +33,9 @@ public function drugList(Request $request)
{
$authInfo = auth('api')->user();
$pharmacy_id = 0;
if ($authInfo->last_login_type== User::LOGIN_TYPE_USER) {
if ($authInfo->last_login_type == User::LOGIN_TYPE_USER) {
$pharmacy_id = $request->input('pharmacy_id');
}else if ($authInfo->last_login_type== User::LOGIN_TYPE_PHARMACY) {
} elseif ($authInfo->last_login_type == User::LOGIN_TYPE_PHARMACY) {
$pharmacy = PharmacyModel::where('user_id', $authInfo->id)->first();
$pharmacy_id = $pharmacy->id;
}
......
......@@ -40,6 +40,7 @@ public function patientList(Request $request)
foreach ($data as $key => $value) {
$data[$key]['age'] = getAgeByIdCard($value['id_card']);
}
return $this->success($data);
}
......
......@@ -16,7 +16,7 @@ public function userInfo()
'name' => $authInfo->name,
'nick_name' => $authInfo->nick_name,
'avatar' => $authInfo->avatar,
'last_login_type'=>$authInfo->last_login_type,
'last_login_type' => $authInfo->last_login_type,
];
return $this->success($data);
......
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