This commit is contained in:
Your Name
2026-03-13 14:08:52 +08:00
parent 08dd9cd307
commit eb283f008b
667 changed files with 8425 additions and 27053 deletions
@@ -95,4 +95,8 @@ class Appointment extends BaseModel
return $this->hasOne('app\adminapi\logic\auth\AdminLogic', 'id', 'doctor_id')
->bind(['doctor_name' => 'name']);
}
public function diagnosis(){
return $this->belongsTo('app\common\model\tcm\Diagnosis', 'patient_id', 'id');
}
}
+15
View File
@@ -77,4 +77,19 @@ class Diagnosis extends BaseModel
{
return !empty($data['past_history']) ? explode(',', $data['past_history']) : [];
}
/**
* @notes BMI 计算(身高cm,体重kg
* @param $value
* @param $data
* @return float|null
*/
public function getBmiAttr($value, $data)
{
if (!empty($data['height']) && !empty($data['weight'])) {
$heightM = $data['height'] / 100;
return round($data['weight'] / ($heightM * $heightM), 2);
}
return null;
}
}