修改关注接口,新增维护用户表
This commit is contained in:
parent
02a534bb1e
commit
1d94c8597c
@ -15,6 +15,7 @@ use App\Model\SystemInquiryConfig;
|
||||
use App\Model\SystemInquiryTime;
|
||||
use App\Model\UserDoctor;
|
||||
use App\Model\UserDoctor as UserDoctorModel;
|
||||
use Hyperf\DbConnection\Db;
|
||||
|
||||
class PatientDoctorService extends BaseService
|
||||
{
|
||||
@ -686,15 +687,27 @@ class PatientDoctorService extends BaseService
|
||||
return success();
|
||||
}
|
||||
|
||||
$data = array();
|
||||
$data['patient_id'] = $user_info['client_user_id'];
|
||||
$data['doctor_id'] = $doctor_id;
|
||||
$patient_follow = PatientFollow::addPatientFollow($data);
|
||||
if (empty($patient_follow)){
|
||||
return fail(HttpEnumCode::SERVER_ERROR);
|
||||
}
|
||||
Db::beginTransaction();
|
||||
try{
|
||||
$data = array();
|
||||
$data['patient_id'] = $user_info['client_user_id'];
|
||||
$data['doctor_id'] = $doctor_id;
|
||||
$patient_follow = PatientFollow::addPatientFollow($data);
|
||||
if (empty($patient_follow)){
|
||||
Db::rollBack();
|
||||
return fail(HttpEnumCode::SERVER_ERROR);
|
||||
}
|
||||
|
||||
return success();
|
||||
$params = array();
|
||||
$params['doctor_id'] = $doctor_id;
|
||||
UserDoctor::inc($params,"number_of_fans");
|
||||
|
||||
Db::commit();
|
||||
return success();
|
||||
} catch (\Exception $e) {
|
||||
Db::rollBack();
|
||||
return fail(HttpEnumCode::SERVER_ERROR, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -716,12 +729,23 @@ class PatientDoctorService extends BaseService
|
||||
return success();
|
||||
}
|
||||
|
||||
$params = array();
|
||||
$params['patient_id'] = $user_info['client_user_id'];
|
||||
$params['doctor_id'] = $doctor_id;
|
||||
PatientFollow::deletePatientFollow($params);
|
||||
Db::beginTransaction();
|
||||
try{
|
||||
$params = array();
|
||||
$params['patient_id'] = $user_info['client_user_id'];
|
||||
$params['doctor_id'] = $doctor_id;
|
||||
PatientFollow::deletePatientFollow($params);
|
||||
|
||||
return success();
|
||||
$params = array();
|
||||
$params['doctor_id'] = $doctor_id;
|
||||
UserDoctor::dec($params,"number_of_fans");
|
||||
|
||||
Db::commit();
|
||||
return success();
|
||||
} catch (\Exception $e) {
|
||||
Db::rollBack();
|
||||
return fail(HttpEnumCode::SERVER_ERROR, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user