修改专家详情服务天书

This commit is contained in:
2023-04-18 13:45:13 +08:00
parent 2e56ddf700
commit 356c7ea6fd
2 changed files with 143 additions and 0 deletions
+59
View File
@@ -0,0 +1,59 @@
<?php
declare(strict_types=1);
namespace App\Model;
use Hyperf\Database\Model\Collection;
use Hyperf\Snowflake\Concern\Snowflake;
/**
* @property int $agreement_id 主键id
* @property int $client_type 客户端类型(1:患者端 2:医生端 3:药师端)
* @property int $agreement_status 协议状态(0:关闭 1:正常)
* @property string $agreement_name 协议名称
* @property string $agreement_content 协议内容
* @property \Carbon\Carbon $created_at 创建时间
* @property \Carbon\Carbon $updated_at 修改时间
*/
class BasicAgreement extends Model
{
use Snowflake;
/**
* The table associated with the model.
*/
protected ?string $table = 'basic_agreement';
/**
* The attributes that are mass assignable.
*/
protected array $fillable = ['agreement_id', 'client_type', 'agreement_status', 'agreement_name', 'agreement_content', 'created_at', 'updated_at'];
protected string $primaryKey = "agreement_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 Collection|array
*/
public static function getList(array $params = [], array $fields = ['*']): Collection|array
{
return self::where($params)->get($fields);
}
}