修正返回值bigint被转义问题

This commit is contained in:
2023-02-23 15:11:45 +08:00
parent ebf34e28e7
commit 27288a9dd9
12 changed files with 229 additions and 46 deletions
+1 -1
View File
@@ -34,7 +34,7 @@ class BasicBank extends Model
/**
* The attributes that should be cast to native types.
*/
protected array $casts = ['bank_id' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime'];
protected array $casts = ['bank_id' => 'string', 'created_at' => 'datetime', 'updated_at' => 'datetime'];
protected string $primaryKey = "bank_id";
+3 -3
View File
@@ -14,7 +14,7 @@ use Hyperf\Snowflake\Concern\Snowflake;
* @property int $year 年(2023
* @property int $month 月(12
* @property int $day 日(01
* @property int $account_month_id 月份账户id
* @property string $date 日期(2022-01-01
* @property string $total_amount_day 订单总金额-日
* @property \Carbon\Carbon $created_at 创建时间
* @property \Carbon\Carbon $updated_at 修改时间
@@ -31,12 +31,12 @@ class DoctorAccountDay extends Model
/**
* The attributes that are mass assignable.
*/
protected array $fillable = ['account_detail_id', 'doctor_id', 'year', 'month', 'day', 'account_month_id', 'total_amount_day', 'created_at', 'updated_at'];
protected array $fillable = ['account_detail_id', 'doctor_id', 'year', 'month', 'day', 'date', 'total_amount_day', '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', 'account_month_id' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime'];
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";
+2 -5
View File
@@ -10,14 +10,11 @@ use Hyperf\Snowflake\Concern\Snowflake;
/**
* @property int $account_month_id 主键id
* @property int $account_id 账户id
* @property int $doctor_id 医生id
* @property int $year 年(2023
* @property int $month 月(12
* @property string $month_date 日期(Y-m
* @property string $total_amount 总金额
* @property string $withdrawal_amount 已提现金额
* @property string $undrawn_amount 未提现金额
* @property string $income_tax 已提现所得税
* @property \Carbon\Carbon $created_at 创建时间
* @property \Carbon\Carbon $updated_at 修改时间
@@ -34,12 +31,12 @@ class DoctorAccountMonth extends Model
/**
* The attributes that are mass assignable.
*/
protected array $fillable = ['account_month_id', 'account_id', 'doctor_id', 'year', 'month', 'month_date', 'total_amount', 'withdrawal_amount', 'undrawn_amount', 'income_tax', 'created_at', 'updated_at'];
protected array $fillable = ['account_month_id', 'doctor_id', 'year', 'month', 'total_amount', 'withdrawal_amount', 'income_tax', 'created_at', 'updated_at'];
/**
* The attributes that should be cast to native types.
*/
protected array $casts = ['account_month_id' => 'integer', 'account_id' => 'integer', 'doctor_id' => 'integer', 'year' => 'integer', 'month' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime'];
protected array $casts = ['account_month_id' => 'integer', 'doctor_id' => 'integer', 'year' => 'integer', 'month' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime'];
protected string $primaryKey = "account_month_id";
+1 -1
View File
@@ -46,7 +46,7 @@ class Hospital extends Model
/**
* The attributes that should be cast to native types.
*/
protected array $casts = ['hospital_id' => 'integer', 'hospital_status' => 'integer', 'province_id' => 'integer', 'city_id' => 'integer', 'county_id' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime'];
protected array $casts = ['hospital_id' => 'string', 'hospital_status' => 'integer', 'province_id' => 'integer', 'city_id' => 'integer', 'county_id' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime'];
protected string $primaryKey = "hospital_id";
+1 -1
View File
@@ -36,7 +36,7 @@ class HospitalDepartmentCustom extends Model
/**
* The attributes that should be cast to native types.
*/
protected array $casts = ['department_custom_id' => 'integer', 'department_id' => 'integer', 'department_status' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime'];
protected array $casts = ['department_custom_id' => 'string', 'department_id' => 'integer', 'department_status' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime'];
protected string $primaryKey = "department_custom_id";
+30 -5
View File
@@ -28,9 +28,11 @@ use Hyperf\Snowflake\Concern\Snowflake;
* @property string $pay_time 支付时间
* @property string $reception_time 接诊时间(已接诊)
* @property string $complete_time 订单完成时间(问诊完成时间)
* @property string $finish_time 订单结束时间
* @property string $settlement_amount_total 订单与医生结算金额
* @property int $settlement_status 订单与医生结算状态(0:未结算 1:已结算)
* @property string $settlement_time 订单与医生结算时间
* @property string $cancel_time 订单取消时间
* @property int $cancel_reason 取消订单原因(1:医生未接诊 2:主动取消 3:无可分配医生 4:客服取消 5:支付超时)
* @property string $cancel_remarks 取消订单备注(自动添加)
* @property string $patient_name 患者姓名-就诊人
@@ -52,7 +54,7 @@ class OrderInquiry extends Model
/**
* The attributes that are mass assignable.
*/
protected array $fillable = ['order_inquiry_id', 'user_id', 'patient_id', 'doctor_id', 'family_id', 'inquiry_type', 'inquiry_mode', 'inquiry_status', 'is_delete', 'inquiry_refund_status', 'inquiry_pay_channel', 'inquiry_pay_status', 'inquiry_no', 'escrow_trade_no', 'amount_total', 'payment_amount_total', 'pay_time', 'reception_time', 'complete_time', 'settlement_amount_total', 'settlement_status', 'settlement_time', 'cancel_reason', 'cancel_remarks', 'patient_name', 'patient_name_mask', 'patient_sex', 'patient_age', 'created_at', 'updated_at'];
protected array $fillable = ['order_inquiry_id', 'user_id', 'patient_id', 'doctor_id', 'family_id', 'inquiry_type', 'inquiry_mode', 'inquiry_status', 'is_delete', 'inquiry_refund_status', 'inquiry_pay_channel', 'inquiry_pay_status', 'inquiry_no', 'escrow_trade_no', 'amount_total', 'payment_amount_total', 'pay_time', 'reception_time', 'complete_time', 'finish_time', 'settlement_amount_total', 'settlement_status', 'settlement_time', 'cancel_time', 'cancel_reason', 'cancel_remarks', 'patient_name', 'patient_name_mask', 'patient_sex', 'patient_age', 'created_at', 'updated_at'];
/**
* The attributes that should be cast to native types.
@@ -104,8 +106,11 @@ class OrderInquiry extends Model
}
/**
* 获取医生接诊列表
* 已完成-已结束
* 获取医生接诊订单列表
* 已结束-已取消
* inquiry_status:问诊订单状态(1:待支付 2:待分配 3:待接诊 4:已接诊 5:已完成 6:已结束 7:已取消)
* inquiry_refund_status:问诊订单退款状态(0:无退款 1:申请退款 2:退款中 3:退款成功 4:拒绝退款 5:退款关闭)
* cancel_reason:取消订单原因(0:默认 1:医生未接诊 2:主动取消 3:无可分配医生 4:客服取消 5:支付超时)
* @param array $params
* @param array $reception_time 接诊时间区间 ['2023-01-02','2023-01-03']
* @param array $fields
@@ -116,8 +121,12 @@ class OrderInquiry extends Model
public static function getDoctorAccountInfoPage(array $params, array $reception_time,array $fields = ["*"], int $page = null, ?int $per_page = 10): mixed
{
$raw = self::where($params)
->whereIn('inquiry_status',[5,6])
->whereBetween('reception_time',$reception_time)
->whereIn('inquiry_status',[6,7])
->whereIn('inquiry_refund_status',[0,3])
->whereIn('cancel_reason',[0,4])
->whereBetween('finish_time',$reception_time)
->orderBy('finish_time')
->orderBy('cancel_time')
->paginate($per_page, $fields, "page", $page);
$data = array();
@@ -129,4 +138,20 @@ class OrderInquiry extends Model
return $data;
}
/**
* 获取医生某一时间段,某种状态的订单金额
* @param array $params
* @param array $reception_time 接诊时间区间
* @param array $inquiry_status_params inquiry_status字段搜索条件
* @return int|mixed|string
*/
public static function getOrderInquiryAmountTotalSum(array $params, array $reception_time,array $inquiry_status_params): mixed
{
return self::where($params)
->whereIn('inquiry_status',$inquiry_status_params)
->whereBetween('reception_time',$reception_time)
->orderBy('reception_time')
->sum("amount_total");
}
}