获取我的账户数据-获取医生服务包每月账单数据
This commit is contained in:
@@ -607,4 +607,30 @@ class OrderInquiry extends Model
|
||||
->orderBy('created_at')
|
||||
->get();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取医生每月账单数据
|
||||
* @param array $params
|
||||
* @param string $year
|
||||
* @param string|int $is_platform_deep_cooperation
|
||||
* @param array $fields
|
||||
* @return \Hyperf\Collection\Collection
|
||||
*/
|
||||
public static function getMonthlyGroupBill(array $params, string $year,string|int $is_platform_deep_cooperation,array $fields = ["*"]): \Hyperf\Collection\Collection
|
||||
{
|
||||
$query = self::select([Db::raw('YEAR(reception_time) AS `year`') ,Db::raw('MONTH(reception_time) AS `month`')])
|
||||
->where($params)
|
||||
->whereNotIn('inquiry_mode', [7,8,9])
|
||||
->whereIn('inquiry_status', [6])
|
||||
->where(Db::raw('YEAR(reception_time)'), $year);
|
||||
|
||||
if ($is_platform_deep_cooperation == 1){
|
||||
$query->whereNotIn('inquiry_type', [2,4]);
|
||||
}
|
||||
|
||||
$result = $query->groupBy([Db::raw('YEAR(reception_time)'),Db::raw('MONTH(reception_time)')])
|
||||
->get($fields);
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user