This commit is contained in:
wucongxing 2023-04-07 17:46:59 +08:00
parent 28829a84b2
commit 7f486b85d9
4 changed files with 28 additions and 39 deletions

View File

@ -164,6 +164,10 @@ class CallBackController extends AbstractController
$imService = new ImService(); $imService = new ImService();
$imService->waitDoctorInquiry($order_inquiry,$user_doctor['user_id'],$order_inquiry['user_id']); $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消息成功"); Log::getInstance()->info("发送im消息成功");
} }
} }

View File

@ -6,7 +6,6 @@ namespace App\Model;
use Hyperf\Database\Model\Model;
use Hyperf\Snowflake\Concern\Snowflake; 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']; 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"; protected string $primaryKey = "account_detail_id";
/** /**
@ -73,16 +67,19 @@ class DoctorAccountDay extends Model
return self::where($params)->sum("total_amount"); return self::where($params)->sum("total_amount");
} }
/** /**
* 新增 * 新增
* @param array $data * @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); return self::create($data);
} }
/** /**
* 自增 * 自增
* @param array $params * @param array $params

View File

@ -296,18 +296,6 @@ class InquiryService extends BaseService
return fail(HttpEnumCode::HTTP_ERROR, $e->getMessage()); 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 = array();
$result['inquiry_no'] = (string)$order_inquiry['inquiry_no']; // 订单编号 $result['inquiry_no'] = (string)$order_inquiry['inquiry_no']; // 订单编号
$result['order_inquiry_id'] = (string)$order_inquiry['order_inquiry_id']; // 订单主键id $result['order_inquiry_id'] = (string)$order_inquiry['order_inquiry_id']; // 订单主键id
@ -867,23 +855,23 @@ class InquiryService extends BaseService
throw new BusinessException("订单数据为空"); throw new BusinessException("订单数据为空");
} }
// 检测问诊订单状态 // // 检测问诊订单状态
if (!in_array($order_inquiry['inquiry_status'], [2, 3, 4, 5, 7])) { // if (!in_array($order_inquiry['inquiry_status'], [2, 3, 4, 5, 7])) {
// 问诊订单状态1:待支付 2:待分配 3:待接诊 4:已接诊 5:已完成 6:已结束 7:已取消) // // 问诊订单状态1:待支付 2:待分配 3:待接诊 4:已接诊 5:已完成 6:已结束 7:已取消)
throw new BusinessException("订单状态错误"); // throw new BusinessException("订单状态错误");
} // }
//
// 检测订单退款状态 // // 检测订单退款状态
if (in_array($order_inquiry['inquiry_refund_status'], [2, 3, 5])) { // if (in_array($order_inquiry['inquiry_refund_status'], [2, 3, 5])) {
// 问诊订单退款状态0:无退款 1:申请退款 2:退款中 3:退款成功 4:拒绝退款 5:退款关闭) // // 问诊订单退款状态0:无退款 1:申请退款 2:退款中 3:退款成功 4:拒绝退款 5:退款关闭)
throw new BusinessException("订单退款状态错误"); // throw new BusinessException("订单退款状态错误");
} // }
//
// 检测支付状态 // // 检测支付状态
if ($order_inquiry['inquiry_pay_status'] != 2) { // if ($order_inquiry['inquiry_pay_status'] != 2) {
// 支付状态1:未支付 2:已支付 3:支付中 4:支付失败 5:支付超时 6:支付关闭 7:已撤销 8:转入退款) // // 支付状态1:未支付 2:已支付 3:支付中 4:支付失败 5:支付超时 6:支付关闭 7:已撤销 8:转入退款)
throw new BusinessException("订单支付状态错误"); // throw new BusinessException("订单支付状态错误");
} // }
// 系统退款编号 // 系统退款编号
$generator = $this->container->get(IdGeneratorInterface::class); $generator = $this->container->get(IdGeneratorInterface::class);

View File

@ -557,14 +557,14 @@ class UserDoctorService extends BaseService
$DoctorAccountService = new DoctorAccountService(); $DoctorAccountService = new DoctorAccountService();
$balance_account = $DoctorAccountService->getDoctorBalanceAccount($user_info['client_user_id']); $balance_account = $DoctorAccountService->getDoctorBalanceAccount($user_info['client_user_id']);
if ($balance_account > 0) { if ($balance_account > 0) {
$balance_account = round($balance_account * 0.75,2); $balance_account = round($balance_account,2);
} }
// 获取医生当日接诊的订单金额 // 获取医生当日接诊的订单金额
$InquiryService = new InquiryService(); $InquiryService = new InquiryService();
$estimate_income = $InquiryService->getDoctorDayAmountTotal($user_info['client_user_id'], date('Y-m-d', time())); $estimate_income = $InquiryService->getDoctorDayAmountTotal($user_info['client_user_id'], date('Y-m-d', time()));
if (!empty($estimate_income)) { 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']); $user_doctor['avatar'] = addAliyunOssWebsite($user_doctor['avatar']);