获取我的账户数据

This commit is contained in:
2023-12-11 15:32:29 +08:00
parent 847a77da57
commit 649ef58f2d
5 changed files with 73 additions and 45 deletions
+17
View File
@@ -6,6 +6,9 @@ namespace App\Model;
use Hyperf\Database\Model\Builder;
use Hyperf\Database\Model\Collection;
use Hyperf\DbConnection\Db;
use Hyperf\Snowflake\Concern\Snowflake;
/**
@@ -103,4 +106,18 @@ class DoctorAccountDay extends Model
{
return self::where($params)->decrement($field,$numeral);
}
/**
* 获取医生账户月份金额
* @param array $params
* @param array $fields
* @return \Hyperf\Collection\Collection
*/
public static function getDoctorMonth(array $params,array $fields = ['*']): \Hyperf\Collection\Collection
{
return self::select(['month',Db::raw('SUM(total_amount) AS `total_amount`')])
->where($params)
->groupBy(['month'])
->get($fields);
}
}
+6 -4
View File
@@ -178,17 +178,19 @@ class OrderInquiry extends Model
* 获取医生某一时间段接诊订单分页数据
* 已结束
* @param array $params
* @param array $reception_time 接诊时间区间 ['2023-01-02','2023-01-03']
* @param array $reception_time 接诊时间区间 ['2023-01','2023-01']
* @param array $inquiry_status_params
* @param array $fields
* @param int|null $page
* @param int|null $per_page
* @return int|mixed|string
*/
public static function getDoctorCreatedDateOrderInquiryPage(array $params, array $reception_time, array $fields = ["*"], int $page = null, ?int $per_page = 10): mixed
public static function getDoctorCreatedDateOrderInquiryPage(array $params, array $reception_time, array $inquiry_status_params,array $fields = ["*"], int $page = null, ?int $per_page = 10): mixed
{
$raw = self::where($params)
->whereBetween('finish_time', $reception_time)
->orderBy('finish_time')
->whereIn('inquiry_status', $inquiry_status_params)
->whereBetween('reception_time', $reception_time)
->orderBy('reception_time')
->paginate($per_page, $fields, "page", $page);
$data = array();