获取我的账户数据
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user