Commit 594f8cc5 by 赵增煜

药店端增加中药筛选

parent f5b68755
...@@ -41,12 +41,17 @@ public function handle() ...@@ -41,12 +41,17 @@ public function handle()
// } // }
// 刷新存量问诊人年龄 // 刷新存量问诊人年龄
$patients = PatientModel::query()->whereNotNull('id_card')->where('age','0')->get(); $query = PatientModel::query()->whereNotNull('id_card')->where('age','0');
$sql = $query->toSql();
dd($sql);
$patients = $query->get();
if( $patients->count() > 0 ){ if( $patients->count() > 0 ){
foreach ($patients as $patient) { foreach ($patients as $patient) {
$patient->age = getAgeByIdCard($patient->id_card); $patient->age = getAgeByIdCard($patient->id_card);
$patient->save(); $patient->save();
} }
}else{
echo "没有需要更新的数据";
} }
} }
} }
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