获取我的账户数据

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);
}
}