hospital-applets-api/app/Model/DoctorAccountMonth.php

68 lines
2.0 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
declare(strict_types=1);
namespace App\Model;
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 修改时间
*/
class DoctorAccountMonth extends Model
{
use Snowflake;
/**
* The table associated with the model.
*/
protected ?string $table = 'doctor_account_month';
/**
* 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'];
/**
* 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 string $primaryKey = "account_month_id";
/**
* 获取信息-单条
* @param array $params
* @param array $fields
* @return object|null
*/
public static function getOne(array $params, array $fields = ['*']): object|null
{
return self::where($params)->first($fields);
}
/**
* 获取信息-多条
* @param array $params
* @param array $fields
* @return object|null
*/
public static function getList(array $params, array $fields = ['*']): object|null
{
return self::where($params)->get($fields);
}
}