修改关注接口,新增维护用户表
This commit is contained in:
parent
02a534bb1e
commit
1d94c8597c
@ -15,6 +15,7 @@ use App\Model\SystemInquiryConfig;
|
|||||||
use App\Model\SystemInquiryTime;
|
use App\Model\SystemInquiryTime;
|
||||||
use App\Model\UserDoctor;
|
use App\Model\UserDoctor;
|
||||||
use App\Model\UserDoctor as UserDoctorModel;
|
use App\Model\UserDoctor as UserDoctorModel;
|
||||||
|
use Hyperf\DbConnection\Db;
|
||||||
|
|
||||||
class PatientDoctorService extends BaseService
|
class PatientDoctorService extends BaseService
|
||||||
{
|
{
|
||||||
@ -686,15 +687,27 @@ class PatientDoctorService extends BaseService
|
|||||||
return success();
|
return success();
|
||||||
}
|
}
|
||||||
|
|
||||||
$data = array();
|
Db::beginTransaction();
|
||||||
$data['patient_id'] = $user_info['client_user_id'];
|
try{
|
||||||
$data['doctor_id'] = $doctor_id;
|
$data = array();
|
||||||
$patient_follow = PatientFollow::addPatientFollow($data);
|
$data['patient_id'] = $user_info['client_user_id'];
|
||||||
if (empty($patient_follow)){
|
$data['doctor_id'] = $doctor_id;
|
||||||
return fail(HttpEnumCode::SERVER_ERROR);
|
$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();
|
return success();
|
||||||
}
|
}
|
||||||
|
|
||||||
$params = array();
|
Db::beginTransaction();
|
||||||
$params['patient_id'] = $user_info['client_user_id'];
|
try{
|
||||||
$params['doctor_id'] = $doctor_id;
|
$params = array();
|
||||||
PatientFollow::deletePatientFollow($params);
|
$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