去除退款接口、修改用户登陆更新openid
This commit is contained in:
parent
d2dfa89d2f
commit
3a07b79c4a
@ -170,11 +170,22 @@ class LoginService extends BaseService
|
|||||||
return fail(HttpEnumCode::USER_STATUS_ERROR);
|
return fail(HttpEnumCode::USER_STATUS_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 更新session_key
|
|
||||||
$data = array();
|
$data = array();
|
||||||
if ($wx_info_data['session_key'] != $result['session_key']) {
|
if ($wx_info_data['session_key'] != $result['session_key']) {
|
||||||
|
// 更新session_key
|
||||||
$data['wx_session_key'] = $wx_info_data['session_key'];
|
$data['wx_session_key'] = $wx_info_data['session_key'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($wx_info_data['openid'] != $result['open_id']) {
|
||||||
|
// 更新open_id
|
||||||
|
$data['open_id'] = $wx_info_data['openid'];
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($wx_info_data['unionid'] != $result['union_id']) {
|
||||||
|
// 更新union_id
|
||||||
|
$data['union_id'] = $wx_info_data['unionid'];
|
||||||
|
}
|
||||||
|
|
||||||
$data['updated_at'] = date('Y-m-d H:i:s', time());
|
$data['updated_at'] = date('Y-m-d H:i:s', time());
|
||||||
|
|
||||||
$params = array();
|
$params = array();
|
||||||
@ -394,6 +405,36 @@ class LoginService extends BaseService
|
|||||||
Db::rollBack();
|
Db::rollBack();
|
||||||
return fail(HttpEnumCode::USER_STATUS_ERROR);
|
return fail(HttpEnumCode::USER_STATUS_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$data = array();
|
||||||
|
if ($wx_info_data['session_key'] != $result['session_key']) {
|
||||||
|
// 更新session_key
|
||||||
|
$data['wx_session_key'] = $wx_info_data['session_key'];
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($wx_info_data['openid'] != $result['open_id']) {
|
||||||
|
// 更新open_id
|
||||||
|
$data['open_id'] = $wx_info_data['openid'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$data['updated_at'] = date('Y-m-d H:i:s', time());
|
||||||
|
|
||||||
|
$params = array();
|
||||||
|
if ($user['user_type'] == 1) {
|
||||||
|
$params['patient_id'] = $result['patient_id'];
|
||||||
|
$res = UserPatientModel::editUserPatient($params, $data);
|
||||||
|
} elseif ($user['user_type'] == 2) {
|
||||||
|
$params['doctor_id'] = $result['doctor_id'];
|
||||||
|
$res = UserDoctorModel::editUserDoctor($params, $data);
|
||||||
|
} elseif ($user['user_type'] == 3) {
|
||||||
|
$params['pharmacist_id'] = $result['pharmacist_id'];
|
||||||
|
$res = UserPharmacistModel::editUserPharmacist($params, $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$res) {
|
||||||
|
Db::rollBack();
|
||||||
|
return fail(HttpEnumCode::SERVER_ERROR);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 记录用户登陆记录
|
// 记录用户登陆记录
|
||||||
|
|||||||
@ -621,7 +621,7 @@ Router::addGroup('/test', function () {
|
|||||||
Router::get('', [TestController::class, 'test']);
|
Router::get('', [TestController::class, 'test']);
|
||||||
|
|
||||||
// 模拟退款
|
// 模拟退款
|
||||||
Router::get('/refund', [TestController::class, 'refund']);
|
// Router::get('/refund', [TestController::class, 'refund']);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user