统一图片全路径返回

This commit is contained in:
2023-02-24 11:32:51 +08:00
parent 34421d2115
commit 9fc01059ef
7 changed files with 118 additions and 6 deletions
+6 -2
View File
@@ -15,8 +15,12 @@ use Hyperf\Snowflake\Concern\Snowflake;
* @property int $client_type 客户端类型(1:患者端 2:医生端 3:药师端)
* @property int $banner_place 展示位置(1:首页)
* @property int $banner_status 状态(0:删除 1:正常 2:禁用)
* @property int $open_with 打开方式(1:小程序 2:网页 3:app)
* @property string $title 标题
* @property string $sub_title 副标题
* @property int $banner_sort 排序值(越大排序越靠前)
* @property string $banner_link 跳转地址
* @property string $remarks 备注
* @property \Carbon\Carbon $created_at 创建时间
* @property \Carbon\Carbon $updated_at 修改时间
*/
@@ -32,12 +36,12 @@ class Banner extends Model
/**
* The attributes that are mass assignable.
*/
protected array $fillable = ['banner_id', 'banner_name', 'banner_path', 'app_type', 'client_type', 'banner_place', 'banner_status', 'banner_sort', 'banner_link', 'created_at', 'updated_at'];
protected array $fillable = ['banner_id', 'banner_name', 'banner_path', 'app_type', 'client_type', 'banner_place', 'banner_status', 'open_with', 'title', 'sub_title', 'banner_sort', 'banner_link', 'remarks', 'created_at', 'updated_at'];
/**
* The attributes that should be cast to native types.
*/
protected array $casts = ['banner_id' => 'integer', 'app_type' => 'integer', 'client_type' => 'integer', 'banner_place' => 'integer', 'banner_status' => 'integer', 'banner_sort' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime'];
protected array $casts = ['banner_id' => 'integer', 'app_type' => 'integer', 'client_type' => 'integer', 'banner_place' => 'integer', 'banner_status' => 'integer', 'open_with' => 'integer', 'banner_sort' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime'];
protected string $primaryKey = "banner_id";
+64
View File
@@ -0,0 +1,64 @@
<?php
declare(strict_types=1);
namespace App\Model;
use Hyperf\Snowflake\Concern\Snowflake;
/**
* @property int $manual_id 主键id
* @property int $app_type 应用程序类型(1:小程序 2:app)
* @property int $client_type 类型(1:患者端 2:医生端 3:药师端)
* @property string $status 状态(0:删除 1:正常 2:禁用)
* @property string $sort 排序值(越大排序越靠前)
* @property string $title 标题
* @property string $content 内容
* @property \Carbon\Carbon $created_at 创建时间
* @property \Carbon\Carbon $updated_at 修改时间
*/
class OperationManual extends Model
{
use Snowflake;
/**
* The table associated with the model.
*/
protected ?string $table = 'operation_manual';
/**
* The attributes that are mass assignable.
*/
protected array $fillable = ['manual_id', 'app_type', 'client_type', 'status', 'sort', 'title', 'content', 'created_at', 'updated_at'];
/**
* The attributes that should be cast to native types.
*/
protected array $casts = ['manual_id' => 'string', 'app_type' => 'integer', 'client_type' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime'];
protected string $primaryKey = "manual_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 object|null
*/
public static function getList(array $params, array $fields = ['*']): object|null
{
return self::where($params)->get($fields);
}
}