This commit is contained in:
2023-04-07 17:46:59 +08:00
parent 28829a84b2
commit 7f486b85d9
4 changed files with 28 additions and 39 deletions
+5 -8
View File
@@ -6,7 +6,6 @@ namespace App\Model;
use Hyperf\Database\Model\Model;
use Hyperf\Snowflake\Concern\Snowflake;
/**
@@ -34,11 +33,6 @@ class DoctorAccountDay extends Model
*/
protected array $fillable = ['account_detail_id', 'doctor_id', 'year', 'month', 'day', 'date', 'total_amount', 'created_at', 'updated_at'];
/**
* The attributes that should be cast to native types.
*/
protected array $casts = ['account_detail_id' => 'integer', 'doctor_id' => 'integer', 'year' => 'integer', 'month' => 'integer', 'day' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime'];
protected string $primaryKey = "account_detail_id";
/**
@@ -73,16 +67,19 @@ class DoctorAccountDay extends Model
return self::where($params)->sum("total_amount");
}
/**
* 新增
* @param array $data
* @return Model|DoctorAccountDay
* @return DoctorAccountDay|\Hyperf\Database\Model\Model
*/
public static function addDoctorAccountDay(array $data): \Hyperf\Database\Model\Model|DoctorAccountDay
public static function addDoctorAccountDay(array $data): DoctorAccountDay|\Hyperf\Database\Model\Model
{
return self::create($data);
}
/**
* 自增
* @param array $params