hospital-applets-api/app/Model/HotSearchKeyword.php
2023-05-04 10:17:48 +08:00

58 lines
1.6 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\Database\Model\Collection;
use Hyperf\Snowflake\Concern\Snowflake;
/**
* @property int $keyword_id 主键id
* @property string $keyword_name 名称
* @property int $client_type 类型1:患者端 2:医生端 3:药师端)
* @property int $keyword_status 状态0:删除 1:正常 2:禁用)
* @property int $keyword_place 位置1:患者端热门搜索)
* @property int $keyword_sort 排序值(越小越靠前)
* @property \Carbon\Carbon $created_at 创建时间
* @property \Carbon\Carbon $updated_at 修改时间
*/
class HotSearchKeyword extends Model
{
use Snowflake;
/**
* The table associated with the model.
*/
protected ?string $table = 'hot_search_keyword';
/**
* The attributes that are mass assignable.
*/
protected array $fillable = ['keyword_id', 'keyword_name', 'client_type', 'keyword_status', 'keyword_place', 'keyword_sort', 'created_at', 'updated_at'];
/**
* 获取信息-单条
* @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 Collection|array
*/
public static function getList(array $params = [], array $fields = ['*']): Collection|array
{
return self::where($params)->orderBy('keyword_sort')->get($fields);
}
}