diff --git a/app/Controller/CallBackController.php b/app/Controller/CallBackController.php index 2c872ab..c9eb596 100644 --- a/app/Controller/CallBackController.php +++ b/app/Controller/CallBackController.php @@ -164,6 +164,10 @@ class CallBackController extends AbstractController $imService = new ImService(); $imService->waitDoctorInquiry($order_inquiry,$user_doctor['user_id'],$order_inquiry['user_id']); + // 发送站内、订阅失败发送短信消息-医生有新问诊 + $MessagePush = new MessagePush($user_doctor['user_id'],$order_inquiry['order_inquiry_id']); + $MessagePush->doctorHaveNewInquiry(); + Log::getInstance()->info("发送im消息成功"); } } diff --git a/app/Model/DoctorAccountDay.php b/app/Model/DoctorAccountDay.php index e06d0d6..c6e3902 100644 --- a/app/Model/DoctorAccountDay.php +++ b/app/Model/DoctorAccountDay.php @@ -6,7 +6,6 @@ namespace App\Model; -use Hyperf\Database\Model\Model; use Hyperf\Snowflake\Concern\Snowflake; /** @@ -34,11 +33,6 @@ class DoctorAccountDay extends Model */ protected array $fillable = ['account_detail_id', 'doctor_id', 'year', 'month', 'day', 'date', 'total_amount', 'created_at', 'updated_at']; - /** - * The attributes that should be cast to native types. - */ - protected array $casts = ['account_detail_id' => 'integer', 'doctor_id' => 'integer', 'year' => 'integer', 'month' => 'integer', 'day' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime']; - protected string $primaryKey = "account_detail_id"; /** @@ -73,16 +67,19 @@ class DoctorAccountDay extends Model return self::where($params)->sum("total_amount"); } + /** * 新增 * @param array $data - * @return Model|DoctorAccountDay + * @return DoctorAccountDay|\Hyperf\Database\Model\Model */ - public static function addDoctorAccountDay(array $data): \Hyperf\Database\Model\Model|DoctorAccountDay + public static function addDoctorAccountDay(array $data): DoctorAccountDay|\Hyperf\Database\Model\Model { return self::create($data); } + + /** * 自增 * @param array $params diff --git a/app/Services/InquiryService.php b/app/Services/InquiryService.php index c3071ce..1f8c586 100644 --- a/app/Services/InquiryService.php +++ b/app/Services/InquiryService.php @@ -296,18 +296,6 @@ class InquiryService extends BaseService return fail(HttpEnumCode::HTTP_ERROR, $e->getMessage()); } - try { - if (!empty($request_params['doctor_id']) && ($request_params['inquiry_type'] == 1 || $request_params['inquiry_type'] == 3)){ - if (isset($doctor)){ - // 发送站内、订阅失败发送短信消息-医生有新问诊 - $MessagePush = new MessagePush($doctor['user_id'],$order_inquiry['order_inquiry_id']); - $MessagePush->doctorHaveNewInquiry(); - } - } - } catch (\Exception $e) { - Log::getInstance()->error("新问诊消息发送失败:" . $e->getMessage()); - } - $result = array(); $result['inquiry_no'] = (string)$order_inquiry['inquiry_no']; // 订单编号 $result['order_inquiry_id'] = (string)$order_inquiry['order_inquiry_id']; // 订单主键id @@ -867,23 +855,23 @@ class InquiryService extends BaseService throw new BusinessException("订单数据为空"); } - // 检测问诊订单状态 - if (!in_array($order_inquiry['inquiry_status'], [2, 3, 4, 5, 7])) { - // 问诊订单状态(1:待支付 2:待分配 3:待接诊 4:已接诊 5:已完成 6:已结束 7:已取消) - throw new BusinessException("订单状态错误"); - } - - // 检测订单退款状态 - if (in_array($order_inquiry['inquiry_refund_status'], [2, 3, 5])) { - // 问诊订单退款状态(0:无退款 1:申请退款 2:退款中 3:退款成功 4:拒绝退款 5:退款关闭) - throw new BusinessException("订单退款状态错误"); - } - - // 检测支付状态 - if ($order_inquiry['inquiry_pay_status'] != 2) { - // 支付状态(1:未支付 2:已支付 3:支付中 4:支付失败 5:支付超时 6:支付关闭 7:已撤销 8:转入退款) - throw new BusinessException("订单支付状态错误"); - } +// // 检测问诊订单状态 +// if (!in_array($order_inquiry['inquiry_status'], [2, 3, 4, 5, 7])) { +// // 问诊订单状态(1:待支付 2:待分配 3:待接诊 4:已接诊 5:已完成 6:已结束 7:已取消) +// throw new BusinessException("订单状态错误"); +// } +// +// // 检测订单退款状态 +// if (in_array($order_inquiry['inquiry_refund_status'], [2, 3, 5])) { +// // 问诊订单退款状态(0:无退款 1:申请退款 2:退款中 3:退款成功 4:拒绝退款 5:退款关闭) +// throw new BusinessException("订单退款状态错误"); +// } +// +// // 检测支付状态 +// if ($order_inquiry['inquiry_pay_status'] != 2) { +// // 支付状态(1:未支付 2:已支付 3:支付中 4:支付失败 5:支付超时 6:支付关闭 7:已撤销 8:转入退款) +// throw new BusinessException("订单支付状态错误"); +// } // 系统退款编号 $generator = $this->container->get(IdGeneratorInterface::class); diff --git a/app/Services/UserDoctorService.php b/app/Services/UserDoctorService.php index 828eea7..324859a 100644 --- a/app/Services/UserDoctorService.php +++ b/app/Services/UserDoctorService.php @@ -557,14 +557,14 @@ class UserDoctorService extends BaseService $DoctorAccountService = new DoctorAccountService(); $balance_account = $DoctorAccountService->getDoctorBalanceAccount($user_info['client_user_id']); if ($balance_account > 0) { - $balance_account = round($balance_account * 0.75,2); + $balance_account = round($balance_account,2); } // 获取医生当日接诊的订单金额 $InquiryService = new InquiryService(); $estimate_income = $InquiryService->getDoctorDayAmountTotal($user_info['client_user_id'], date('Y-m-d', time())); if (!empty($estimate_income)) { - $estimate_income = round($estimate_income * 0.75,2); + $estimate_income = round($estimate_income,2); } $user_doctor['avatar'] = addAliyunOssWebsite($user_doctor['avatar']);