修改专家详情服务天书

This commit is contained in:
wucongxing 2023-04-18 13:45:13 +08:00
parent 2e56ddf700
commit 356c7ea6fd
2 changed files with 143 additions and 0 deletions

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);
}
}

84
app/Model/Popup.php Normal file
View File

@ -0,0 +1,84 @@
<?php
declare(strict_types=1);
namespace App\Model;
use Hyperf\Database\Model\Collection;
use Hyperf\Snowflake\Concern\Snowflake;
/**
* @property int $popup_id 主键id
* @property int $user_id 用户id
* @property int $app_type 应用程序类型1:小程序 2:app
* @property int $client_type 客户端类型1:患者端 2:医生端 3:药师端)
* @property int $status 状态0:未弹 1:已弹)
* @property int $popup_type 弹窗类型1:结算费用)
* @property string $popup_title 标题
* @property string $popup_content 内容
* @property string $popup_img 封面图片
* @property string $popup_link 跳转地址
* @property \Carbon\Carbon $created_at 创建时间
* @property \Carbon\Carbon $updated_at 修改时间
*/
class Popup extends Model
{
use Snowflake;
/**
* The table associated with the model.
*/
protected ?string $table = 'popup';
/**
* The attributes that are mass assignable.
*/
protected array $fillable = ['popup_id', 'user_id', 'app_type', 'client_type', 'status', 'popup_type', 'popup_title', 'popup_content', 'popup_img', 'popup_link', 'created_at', 'updated_at'];
protected string $primaryKey = "popup_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);
}
/**
* 新增
* @param array $data
* @return \Hyperf\Database\Model\Model|Popup
*/
public static function addPopup(array $data): \Hyperf\Database\Model\Model|Popup
{
return self::create($data);
}
/**
* 修改
* @param array $params
* @param array $data
* @return int
*/
public static function edit(array $params = [], array $data = []): int
{
return self::where($params)->update($data);
}
}