新增获取家庭成员时如年龄不对,进行更改
This commit is contained in:
parent
c474cba67b
commit
641a304caf
@ -7,6 +7,7 @@ use App\Model\BasicJob;
|
||||
use App\Model\BasicNation;
|
||||
use App\Model\DiseaseClass;
|
||||
use App\Model\OrderProduct;
|
||||
use App\Model\PatientFamily;
|
||||
use App\Model\PatientFamily as PatientFamilyModel;
|
||||
use App\Model\PatientFamilyHealth;
|
||||
use App\Model\PatientFamilyPersonal as PatientFamilyPersonalModel;
|
||||
@ -55,8 +56,20 @@ class PatientFamilyService extends BaseService
|
||||
$patient_familys = $patient_familys->toArray();
|
||||
foreach ($patient_familys as &$value){
|
||||
// 计算年龄
|
||||
$value['age'] = getIdCardAge($value['id_number']);
|
||||
$age = getIdCardAge($value['id_number']);
|
||||
unset($value['id_number']);
|
||||
|
||||
// 修正年龄
|
||||
if ($value['age'] != $age){
|
||||
$params = array();
|
||||
$params['family_id'] = $value['family_id'];
|
||||
|
||||
$data = array();
|
||||
$data['age'] = $age;
|
||||
PatientFamily::edit($params,$data);
|
||||
|
||||
$value['age'] = $age;
|
||||
}
|
||||
}
|
||||
|
||||
return success($patient_familys);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user