新增修改用户配置,获取用户配置接口
This commit is contained in:
@@ -124,86 +124,6 @@ class OrderPrescriptionService extends BaseService
|
||||
return OrderPrescription::getCount($params);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 开具处方
|
||||
// * 医生-正常开具
|
||||
// * 药师-先开具药师处方,再开具医院签章
|
||||
// * @param string $order_prescription_id 处方id
|
||||
// * @param string $user_id 用户id
|
||||
// * @return array
|
||||
// */
|
||||
// public function openPrescription1(string $order_prescription_id, string $user_id): array
|
||||
// {
|
||||
// try {
|
||||
// // 获取用户数据
|
||||
// $params = array();
|
||||
// $params['user_id'] = $user_id;
|
||||
// $user = User::getOne($params);
|
||||
// if (empty($user)) {
|
||||
// throw new BusinessException("用户数据错误");
|
||||
// }
|
||||
//
|
||||
// if ($user['user_type'] != 2 && $user['user_type'] != 3) {
|
||||
// throw new BusinessException("用户类型错误");
|
||||
// }
|
||||
//
|
||||
// // 获取处方数据
|
||||
// $params = array();
|
||||
// $params['order_prescription_id'] = $order_prescription_id;
|
||||
// $order_prescription = OrderPrescription::getOne($params);
|
||||
// if (empty($order_prescription)) {
|
||||
// throw new BusinessException("处方数据错误");
|
||||
// }
|
||||
//
|
||||
// if (empty($order_prescription['doctor_created_time'])) {
|
||||
// throw new BusinessException("医生开方日期错误");
|
||||
// }
|
||||
//
|
||||
// $CaService = new CaService($order_prescription,$user);
|
||||
//
|
||||
// // 获取云证书签名+验证云证书签名
|
||||
// $CaService->getVerifyCertSign($order_prescription,1);
|
||||
//
|
||||
// // 医生
|
||||
// if ($user['user_type'] == 2) {
|
||||
// // 生成处方图片+处方图片生成pdf
|
||||
// $prescription_img_oss_path = $CaService->createPrescriptionImgPdf($order_prescription);
|
||||
// }
|
||||
//
|
||||
// // 药师-医院签章
|
||||
// if ($user['user_type'] == 3) {
|
||||
// // 获取医院云证书签名+验证云证书签名
|
||||
// $CaService->getVerifyCertSign($order_prescription,2);
|
||||
//
|
||||
// // 下载医生开具的处方pdf至本地
|
||||
// $CaService->downOssPdfToLocal();
|
||||
// }
|
||||
//
|
||||
// // 进行处方pdf签章
|
||||
// $file_id = $CaService->addSignPdf($user['user_type']);
|
||||
//
|
||||
// // 药师-医院签章
|
||||
// if ($user['user_type'] == 3) {
|
||||
// // 药师端时,需要进行系统签章
|
||||
// // 把药师签章的pdf存储至本地文件
|
||||
// // 下载药师签章pdf图片
|
||||
// dump($file_id);
|
||||
// $CaService->downCaPdfToLocal($file_id,1);
|
||||
//
|
||||
// // 进行处方pdf签章
|
||||
// $file_id = $CaService->addSignPdf($user['user_type']);
|
||||
// }
|
||||
//
|
||||
// $result = array();
|
||||
// $result['prescription_img_oss_path'] = $prescription_img_oss_path ?? "";
|
||||
// $result['file_id'] = $file_id;
|
||||
// return $result;
|
||||
//
|
||||
// } catch (\Throwable $e) {
|
||||
// throw new BusinessException($e->getMessage());
|
||||
// }
|
||||
// }
|
||||
|
||||
/**
|
||||
* 开具处方
|
||||
* 医生-正常开具
|
||||
|
||||
@@ -13,6 +13,7 @@ use App\Model\UserDoctorInfo;
|
||||
use App\Model\UserLocation;
|
||||
use App\Model\UserPatient;
|
||||
use App\Model\UserShipAddress;
|
||||
use App\Model\UserSystem;
|
||||
use App\Utils\Mask;
|
||||
use App\Utils\PcreMatch;
|
||||
use Extend\Tencent\map\Location;
|
||||
@@ -686,6 +687,75 @@ class UserService extends BaseService
|
||||
return success($area);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户配置
|
||||
* @return array
|
||||
*/
|
||||
public function getUserSystem(): array
|
||||
{
|
||||
$user_info = $this->request->getAttribute("userInfo") ?? [];
|
||||
|
||||
// 定义返回数据
|
||||
$result = array(
|
||||
"is_accept_im_message_push" => 0,
|
||||
);
|
||||
|
||||
// 获取用户配置数据
|
||||
$params = array();
|
||||
$params['user_id'] = $user_info['user_id'];
|
||||
$user_system = UserSystem::getOne($params);
|
||||
if (empty($user_system)){
|
||||
return success($result);
|
||||
}
|
||||
|
||||
$result['is_accept_im_message_push'] = 0;
|
||||
return success($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户配置
|
||||
* @return array
|
||||
*/
|
||||
public function putUserSystem(): array
|
||||
{
|
||||
$user_info = $this->request->getAttribute("userInfo") ?? [];
|
||||
$request_params = $this->request->all();
|
||||
|
||||
// 获取用户配置数据
|
||||
$params = array();
|
||||
$params['user_id'] = $user_info['user_id'];
|
||||
$user_system = UserSystem::getOne($params);
|
||||
if (empty($user_system)){
|
||||
// 新增
|
||||
$data = array();
|
||||
$data['user_id'] = $user_info['user_id'];
|
||||
$data['is_accept_im_message_push'] = $request_params['is_accept_im_message_push'];
|
||||
$user_system = UserSystem::addUserSystem($data);
|
||||
if (empty($user_system)){
|
||||
return fail();
|
||||
}
|
||||
}else{
|
||||
// 修改
|
||||
$data = array();
|
||||
|
||||
if ($user_system['is_accept_im_message_push'] != $request_params['is_accept_im_message_push']){
|
||||
$data['is_accept_im_message_push'] = $request_params['is_accept_im_message_push'];
|
||||
}
|
||||
|
||||
if (!empty($data)){
|
||||
$params = array();
|
||||
$params['user_system_id'] = $user_system['user_system_id'];
|
||||
|
||||
$res = UserSystem::edit($params,$data);
|
||||
if (!$res){
|
||||
return fail();
|
||||
}
|
||||
}
|
||||
}
|
||||
return success();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通过user_id获取用户openid
|
||||
* @param string|int $user_id
|
||||
|
||||
Reference in New Issue
Block a user