统一图片全路径返回

This commit is contained in:
wucongxing 2023-02-24 11:32:51 +08:00
parent 34421d2115
commit 9fc01059ef
7 changed files with 118 additions and 6 deletions

View File

@ -51,4 +51,15 @@ class BasicDataController extends AbstractController
$data = $BasicDataService->getBank();
return $this->response->json($data);
}
/**
* 获取操作手册列表
* @return ResponseInterface
*/
public function getOperationManual(): ResponseInterface
{
$BasicDataService = new BasicDataService();
$data = $BasicDataService->getOperationManual();
return $this->response->json($data);
}
}

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";

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

View File

@ -5,6 +5,7 @@ namespace App\Services;
use App\Model\BasicBank;
use App\Model\Hospital;
use App\Model\HospitalDepartmentCustom;
use App\Model\OperationManual;
/**
* 基础数据服务类
@ -88,4 +89,21 @@ class BasicDataService extends BaseService
return success($basic_bank->toArray());
}
/**
* 获取操作手册列表
* @return array
*/
public function getOperationManual(): array
{
$params = array();
$params['status'] = 1;
$operation_manual = OperationManual::getList($params);
if (empty($operation_manual)){
return success();
}
return success($operation_manual->toArray());
}
}

View File

@ -245,7 +245,10 @@ class DoctorAccountService extends BaseService
return success($order_inquiry);
}
// 获取医生提现记录列表
/**
* 获取医生提现记录列表
* @return array
*/
public function getDoctorWithdrawalRecordList(): array
{
$user_info = $this->request->getAttribute("userInfo") ?? [];

View File

@ -98,7 +98,7 @@ class IndexService extends BaseService
$info['iden_auth_status'] = $doctor['iden_auth_status'];// 身份认证状态0:未认证 1:认证通过 2:审核中 3:认证失败)
$info['multi_point_status'] = $doctor['multi_point_status'];// 医生多点执业认证状态0:未认证 1:认证通过 2:审核中 3:认证失败)
$info['is_bind_bank'] = $doctor['is_bind_bank'];// 是否已绑定结算银行卡0:否 1:是)
$info['avatar'] = $doctor['avatar'];
$info['avatar'] = addAliyunOssWebsite($doctor['avatar']);
$info['is_img_expert_reception'] = $doctor['is_img_expert_reception'];// 是否参加专家图文接诊0:否 1:是)
$info['is_img_welfare_reception'] = $doctor['is_img_welfare_reception'];// 是否参加公益图文问诊0:否 1:是)
$info['praise_rate'] = $doctor['praise_rate'];// 好评率百分制。回复质量占4、服务态度占3、回复速度占3。每周计算一次
@ -131,6 +131,11 @@ class IndexService extends BaseService
$params["banner_place"] = 1;
$params["banner_status"] = 1;
$banner = BannerModel::getList($params);
if (!empty($banner)){
foreach ($banner as &$item){
$item['banner_path'] = addAliyunOssWebsite($item['banner_path']);
}
}
// 获取模块
$params = array();
@ -192,6 +197,8 @@ class IndexService extends BaseService
return fail(HttpEnumCode::USER_STATUS_ERROR);
}
$user_pharmacist['avatar'] = addAliyunOssWebsite($user_pharmacist['avatar']);
// 获取药师审方数量
$params = array();
$params['pharmacist_id'] = $user_pharmacist['pharmacist_id'];
@ -236,7 +243,7 @@ class IndexService extends BaseService
$data = array();
$data['doctor_id'] = $patient_history_doctor['userDoctor']['doctor_id'];
$data['user_name'] = $patient_history_doctor['userDoctor']['user_name'];
$data['avatar'] = $patient_history_doctor['userDoctor']['avatar'];
$data['avatar'] = addAliyunOssWebsite($patient_history_doctor['userDoctor']['avatar']);
$data['hospital_name'] = "";
if (!empty($patient_history_doctor['userDoctor']['Hospital'])) {
$data['hospital_name'] = $patient_history_doctor['userDoctor']['Hospital']['hospital_name'];
@ -294,7 +301,7 @@ class IndexService extends BaseService
$data['user_name'] = $recommend_doctor['user_name'];
$data['status'] = $recommend_doctor['status'];
$data['multi_point_status'] = $recommend_doctor['multi_point_status']; // 医生多点执业认证状态0:未认证 1:认证通过 2:审核中 3:认证失败)
$data['avatar'] = $recommend_doctor['avatar'];
$data['avatar'] = addAliyunOssWebsite($recommend_doctor['avatar']);
$data['doctor_title'] = empty($recommend_doctor['doctor_title']) ? "" : DoctorTitleCode::getMessage($recommend_doctor['doctor_title']);
$data['department_custom_name'] = $recommend_doctor['department_custom_name'];
$data['is_online'] = $recommend_doctor['is_online'];

View File

@ -130,6 +130,8 @@ Router::addGroup('/doctor', function () {
// 获取处方列表
Router::get('', [UserDoctorController::class, 'getPrescriptionList']);
});
});
/**
@ -258,5 +260,8 @@ Router::addGroup('/basic', function () {
// 获取银行列表
Router::get('/bank', [BasicDataController::class, 'getBank']);
// 获取操作手册列表
Router::get('/operation/manual', [BasicDataController::class, 'getOperationManual']);
});