123456789101112131415161718192021222324252627282930313233343536373839 |
- <?php
- namespace app\common\library;
- use app\api\model\exam\ExamModel;
- use app\api\model\patientbind\PatientbindModel;
- use app\api\model\patientsearch\PatientsearchModel;
- /**
- * 存储手机号的同时
- * 同步公众号信息
- */
- class PublicPhone {
- public static function savePublicSearch($phone,$examId)
- {
- if(empty($phone) || empty($examId))
- {
- return '';
- }
- $userId = PatientbindModel::where('phone',$phone)->where('status',1)->value('user_id');
- $ins = ExamModel::where('id',$examId)->value('institution_id');
- if(empty($userId))
- {
- return '';
- }
- $data = [
- 'search_criteria'=>$phone,
- 'search_field'=>'phone',
- 'patient_uid'=>$userId,
- 'phone'=>$phone,
- 'institution_id'=>$ins,
- 'search_result'=>'1',
- 'exam_id'=>$examId,
- ];
- PatientsearchModel::insert($data);
- return '';
- }
- }
|