feat: spu

This commit is contained in:
2025-01-06 18:02:57 +08:00
parent 0895955973
commit fd18cffeab
12 changed files with 505 additions and 6 deletions

View File

@@ -4,6 +4,7 @@ declare(strict_types=1);
namespace App\Model;
use Hyperf\Database\Model\Builder;
use Hyperf\DbConnection\Model\Model;
/**
@@ -24,8 +25,22 @@ class Cycle extends Model
*/
protected array $fillable = [];
protected array $guarded = [];
/**
* The attributes that should be cast to native types.
*/
protected array $casts = ['id' => 'integer', 'is_use' => 'integer'];
const string CREATED_AT = 'create_time';
const null UPDATED_AT = null;
/**
* @param string $date
* @return Builder|\Hyperf\Database\Model\Model|null
*/
public function getInfoByDate(string $date): \Hyperf\Database\Model\Model|Builder|null
{
return $this->where('dates',$date)->first();
}
}