Merge branch 'dev'
This commit is contained in:
commit
6a936a8222
137
app/Controller/ArticleController.php
Normal file
137
app/Controller/ArticleController.php
Normal file
@ -0,0 +1,137 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Model\ArticleScience;
|
||||
use App\Request\ArticleRequest;
|
||||
use App\Request\PatientDoctorRequest;
|
||||
use App\Services\PatientDoctorService;
|
||||
use App\Utils\Log;
|
||||
use Psr\Container\ContainerExceptionInterface;
|
||||
use Psr\Container\NotFoundExceptionInterface;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
|
||||
/**
|
||||
* 文章管理
|
||||
*/
|
||||
class ArticleController extends AbstractController
|
||||
{
|
||||
/**
|
||||
* 获取科普文章列表-分页
|
||||
* @return ResponseInterface
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function getArticleSciencePage(): ResponseInterface
|
||||
{
|
||||
$request = $this->container->get(ArticleRequest::class);
|
||||
$request->scene('getArticleSciencePage')->validateResolved();
|
||||
|
||||
$keyword = $this->request->input('keyword',"");
|
||||
$is_top = $this->request->input('is_top');
|
||||
$source_id = $this->request->input('source_id');
|
||||
$basic_class_id = $this->request->input('basic_class_id');
|
||||
$page = $this->request->input('page',1);
|
||||
$per_page = $this->request->input('per_page',10);
|
||||
|
||||
// 组合条件
|
||||
$article_science_params = array();// 文章搜索
|
||||
$article_science_class_params = array();// 文章分类搜索
|
||||
|
||||
// 文章状态(1:正常 2:禁用)
|
||||
$article_science_params["article_status"] = 1;
|
||||
|
||||
// 是否置顶(0:否 1:是)
|
||||
if (!empty($is_top)){
|
||||
$article_science_params['is_top'] = $is_top;
|
||||
}
|
||||
|
||||
// 来源id
|
||||
if (!empty($source_id)){
|
||||
$article_science_params['source_id'] = $source_id;
|
||||
}
|
||||
|
||||
// 分类id
|
||||
if (!empty($basic_class_id)){
|
||||
$article_science_class_params['basic_class_id'] = $basic_class_id;
|
||||
}
|
||||
|
||||
$fields = ["*"];
|
||||
$article_sciences = ArticleScience::getArticleSciencePage($keyword,$article_science_params, $article_science_class_params, $fields,$page,$per_page);
|
||||
if (!empty($article_sciences['data'])) {
|
||||
foreach ($article_sciences['data'] as &$article_science) {
|
||||
$article_science['article_image'] = addAliyunOssWebsite($article_science['article_image']);
|
||||
if (!empty($article_science["ArticleScienceSource"])){
|
||||
// 深拷贝 ArticleScienceSource 对象
|
||||
$clonedSource = clone $article_science["ArticleScienceSource"];
|
||||
|
||||
|
||||
// 修改克隆对象的 source_image 字段
|
||||
$clonedSource["source_image"] = addAliyunOssWebsite($clonedSource["source_image"]);
|
||||
|
||||
// 将修改后的克隆对象赋回原数组
|
||||
$article_science["article_science_source"] = $clonedSource;
|
||||
unset($clonedSource);
|
||||
unset($article_science["ArticleScienceSource"]);
|
||||
}
|
||||
|
||||
unset($article_science);
|
||||
}
|
||||
}
|
||||
return $this->response->json(success($article_sciences));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取科普文章列表
|
||||
* @return ResponseInterface
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function getArticleScienceList(): ResponseInterface
|
||||
{
|
||||
$request = $this->container->get(ArticleRequest::class);
|
||||
$request->scene('getArticleScienceList')->validateResolved();
|
||||
|
||||
$keyword = $this->request->input('keyword',"");
|
||||
$is_top = $this->request->input('is_top');
|
||||
$source_id = $this->request->input('source_id');
|
||||
$basic_class_id = $this->request->input('basic_class_id');
|
||||
|
||||
// 组合条件
|
||||
$article_science_params = array();// 文章搜索
|
||||
$article_science_class_params = array();// 文章分类搜索
|
||||
|
||||
// 文章状态(1:正常 2:禁用)
|
||||
$article_science_params["article_status"] = 1;
|
||||
|
||||
// 是否置顶(0:否 1:是)
|
||||
if (!empty($is_top)){
|
||||
$article_science_params['is_top'] = $is_top;
|
||||
}
|
||||
|
||||
// 来源id
|
||||
if (!empty($source_id)){
|
||||
$article_science_params['source_id'] = $source_id;
|
||||
}
|
||||
|
||||
// 分类id
|
||||
if (!empty($basic_class_id)){
|
||||
$article_science_class_params['basic_class_id'] = $basic_class_id;
|
||||
}
|
||||
|
||||
$fields = ["*"];
|
||||
$article_sciences = ArticleScience::getArticleScienceList($keyword,$article_science_params, $article_science_class_params, $fields);
|
||||
$article_sciences = $article_sciences->toArray();
|
||||
if (!empty($article_sciences)) {
|
||||
foreach ($article_sciences as &$article_science) {
|
||||
$article_science['article_image'] = addAliyunOssWebsite($article_science['article_image']);
|
||||
|
||||
if (!empty($article_science["article_science_source"])){
|
||||
$article_science["article_science_source"]["source_image"] = addAliyunOssWebsite($article_science["article_science_source"]["source_image"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $this->response->json(success($article_sciences));
|
||||
}
|
||||
}
|
||||
@ -74,6 +74,20 @@ class PatientDoctorController extends AbstractController
|
||||
return $this->response->json($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取我历史问诊医生列表
|
||||
* @return ResponseInterface
|
||||
*/
|
||||
public function getHistoryDoctorList(): ResponseInterface
|
||||
{
|
||||
$user_info = $this->request->getAttribute("userInfo") ?? [];
|
||||
|
||||
$PatientDoctorService = new PatientDoctorService();
|
||||
$data = $PatientDoctorService->getIndexPatientDoctorLimit($user_info['client_user_id']);
|
||||
|
||||
return $this->response->json($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取医生评价
|
||||
* @return ResponseInterface
|
||||
|
||||
159
app/Model/ArticleScience.php
Normal file
159
app/Model/ArticleScience.php
Normal file
@ -0,0 +1,159 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Model;
|
||||
|
||||
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Hyperf\Database\Model\Collection;
|
||||
use Hyperf\Database\Model\Relations\HasMany;
|
||||
use Hyperf\Database\Model\Relations\HasOne;
|
||||
use Hyperf\DbConnection\Db;
|
||||
use Hyperf\Snowflake\Concern\Snowflake;
|
||||
|
||||
/**
|
||||
* @property int $article_id 主键id
|
||||
* @property string $article_title 文章标题
|
||||
* @property int $article_status 文章状态(1:正常 2:禁用)
|
||||
* @property int $is_top 是否置顶(0:否 1:是)
|
||||
* @property int $sort 排序值(越大越靠前)
|
||||
* @property string $article_image 文章图片(1张)
|
||||
* @property int $source_id 文章来源id
|
||||
* @property string $article_url 文章地址
|
||||
* @property \Carbon\Carbon $created_at 创建时间
|
||||
* @property \Carbon\Carbon $updated_at 修改时间
|
||||
* @property-read ArticleScienceSource|null $ArticleScienceSource
|
||||
* @property-read \Hyperf\Database\Model\Collection|ArticleScienceClass[]|null $ArticleScienceClass
|
||||
*/
|
||||
class ArticleScience extends Model
|
||||
{
|
||||
use Snowflake;
|
||||
|
||||
/**
|
||||
* The table associated with the model.
|
||||
*/
|
||||
protected ?string $table = 'article_science';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected array $fillable = ['article_id', 'article_title', 'article_status', 'is_top', 'sort', 'article_image', 'source_id', 'article_url', 'created_at', 'updated_at'];
|
||||
|
||||
protected string $primaryKey = "article_id";
|
||||
|
||||
/**
|
||||
* 关联来源
|
||||
*/
|
||||
public function ArticleScienceSource(): HasOne
|
||||
{
|
||||
return $this->hasOne(ArticleScienceSource::class, 'source_id', 'source_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* 关联分类
|
||||
* @return HasMany
|
||||
*/
|
||||
public function ArticleScienceClass(): HasMany
|
||||
{
|
||||
return $this->hasMany(ArticleScienceClass::class, "article_id", "article_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 string $keyword
|
||||
* @param array $article_science_params 搜索条件
|
||||
* @param array $article_science_class_params 分类搜索条件
|
||||
* @param array $fields
|
||||
* @param int|null $page
|
||||
* @param int|null $per_page
|
||||
* @return array
|
||||
*/
|
||||
public static function getArticleSciencePage(string $keyword = "", array $article_science_params = [], array $article_science_class_params = [], array $fields = ["*"], int $page = null, ?int $per_page = 10): array
|
||||
{
|
||||
$query = self::with(['ArticleScienceSource'])
|
||||
->where($article_science_params)
|
||||
->when($keyword, function ($query, $keyword) {
|
||||
$query->where(function ($query) use ($keyword) {
|
||||
$query->orwhere("article_title", 'like', '%' . $keyword . '%');
|
||||
$query->orWhereHas('ArticleScienceSource', function ($query) use ($keyword) {
|
||||
$query->where('source_name', 'like', '%' . $keyword . '%');
|
||||
});
|
||||
$query->orWhereHas('ArticleScienceClass.BasicArticleClass', function ($query) use ($keyword) {
|
||||
$query->where('basic_class_name', 'like', '%' . $keyword . '%');
|
||||
});
|
||||
});
|
||||
})
|
||||
->whereHas('ArticleScienceClass.BasicArticleClass', function ($query) use ($article_science_class_params) {
|
||||
$query->where($article_science_class_params);
|
||||
});
|
||||
|
||||
$result = $query->orderBy("is_top","desc")->orderBy("sort","desc")->orderBy("created_at","desc")->paginate($per_page, $fields, "page", $page);
|
||||
|
||||
$data = array();
|
||||
$data['current_page'] = $result->currentPage();// 当前页码
|
||||
$data['total'] = $result->total();//数据总数
|
||||
$data['data'] = $result->items();//数据
|
||||
$data['per_page'] = $result->perPage();//每页个数
|
||||
$data['last_page'] = $result->lastPage();//最后一页
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取列表
|
||||
* @param string $keyword
|
||||
* @param array $article_science_params 搜索条件
|
||||
* @param array $article_science_class_params 分类搜索条件
|
||||
* @param array $fields
|
||||
* @param int $limit
|
||||
* @return Collection|array
|
||||
*/
|
||||
public static function getArticleScienceList(string $keyword = "", array $article_science_params = [], array $article_science_class_params = [], array $fields = ["*"], int $limit = 10): Collection|array
|
||||
{
|
||||
$query = self::with(['ArticleScienceSource'])
|
||||
->where($article_science_params)
|
||||
->when($keyword, function ($query, $keyword) {
|
||||
$query->where(function ($query) use ($keyword) {
|
||||
$query->orwhere("article_title", 'like', '%' . $keyword . '%');
|
||||
$query->orWhereHas('ArticleScienceSource', function ($query) use ($keyword) {
|
||||
$query->where('source_name', 'like', '%' . $keyword . '%');
|
||||
});
|
||||
$query->orWhereHas('ArticleScienceClass.BasicArticleClass', function ($query) use ($keyword) {
|
||||
$query->where('basic_class_name', 'like', '%' . $keyword . '%');
|
||||
});
|
||||
});
|
||||
})
|
||||
->whereHas('ArticleScienceClass.BasicArticleClass', function ($query) use ($article_science_class_params) {
|
||||
$query->where($article_science_class_params);
|
||||
});
|
||||
|
||||
$data = $query->orderBy("is_top","desc")->orderBy("sort","desc")->orderBy("created_at","desc")->limit($limit)->get($fields);
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
}
|
||||
67
app/Model/ArticleScienceClass.php
Normal file
67
app/Model/ArticleScienceClass.php
Normal file
@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Model;
|
||||
|
||||
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Hyperf\Database\Model\Collection;
|
||||
use Hyperf\Database\Model\Relations\HasOne;
|
||||
use Hyperf\Snowflake\Concern\Snowflake;
|
||||
|
||||
/**
|
||||
* @property int $class_id 主键id
|
||||
* @property int $article_id 文章-科普id
|
||||
* @property int $basic_class_id 基础数据-科普-分类id
|
||||
* @property Carbon $created_at 创建时间
|
||||
* @property Carbon $updated_at 修改时间
|
||||
*/
|
||||
class ArticleScienceClass extends Model
|
||||
{
|
||||
use Snowflake;
|
||||
|
||||
/**
|
||||
* The table associated with the model.
|
||||
*/
|
||||
protected ?string $table = 'article_science_class';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected array $fillable = ['class_id', 'article_id', 'basic_class_id', 'created_at', 'updated_at'];
|
||||
|
||||
protected string $primaryKey = "class_id";
|
||||
|
||||
/**
|
||||
* 关联基础分类
|
||||
*/
|
||||
public function BasicArticleClass(): HasOne
|
||||
{
|
||||
return $this->hasOne(BasicArticleClass::class, 'basic_class_id', 'basic_class_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);
|
||||
}
|
||||
|
||||
}
|
||||
57
app/Model/ArticleScienceSource.php
Normal file
57
app/Model/ArticleScienceSource.php
Normal file
@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Model;
|
||||
|
||||
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Hyperf\Database\Model\Collection;
|
||||
use Hyperf\Snowflake\Concern\Snowflake;
|
||||
|
||||
/**
|
||||
* @property int $source_id 主键id
|
||||
* @property string $source_name 来源名称
|
||||
* @property string $source_image 来源图片
|
||||
* @property Carbon $created_at 创建时间
|
||||
* @property Carbon $updated_at 修改时间
|
||||
*/
|
||||
class ArticleScienceSource extends Model
|
||||
{
|
||||
use Snowflake;
|
||||
|
||||
/**
|
||||
* The table associated with the model.
|
||||
*/
|
||||
protected ?string $table = 'article_science_source';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected array $fillable = ['source_id', 'source_name', 'source_image', 'created_at', 'updated_at'];
|
||||
|
||||
protected string $primaryKey = "source_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);
|
||||
}
|
||||
}
|
||||
58
app/Model/BasicArticleClass.php
Normal file
58
app/Model/BasicArticleClass.php
Normal file
@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Model;
|
||||
|
||||
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Hyperf\Database\Model\Collection;
|
||||
use Hyperf\Snowflake\Concern\Snowflake;
|
||||
|
||||
/**
|
||||
* @property int $basic_class_id 主键id
|
||||
* @property string $basic_class_name 分类名称
|
||||
* @property int $basic_class_sort 排序(越大排序越靠前)
|
||||
* @property Carbon $created_at 创建时间
|
||||
* @property Carbon $updated_at 修改时间
|
||||
*/
|
||||
class BasicArticleClass extends Model
|
||||
{
|
||||
use Snowflake;
|
||||
|
||||
/**
|
||||
* The table associated with the model.
|
||||
*/
|
||||
protected ?string $table = 'basic_article_class';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected array $fillable = ['basic_class_id', 'basic_class_name', 'basic_class_sort', 'created_at', 'updated_at'];
|
||||
|
||||
protected string $primaryKey = "basic_class_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);
|
||||
}
|
||||
|
||||
}
|
||||
@ -170,12 +170,10 @@ class UserDoctor extends Model
|
||||
* 2:接诊量由高到低的医生
|
||||
* 3:好评率由高到低的医生
|
||||
* 5:在线
|
||||
* 6:5个
|
||||
* @param int $limit 数量
|
||||
* @param array $fields
|
||||
* @return array|Collection|\Hyperf\Utils\Collection
|
||||
*/
|
||||
public static function getIndexRecommendDoctorLimit(int $limit = 5, array $fields = ['*']): array|Collection|\Hyperf\Utils\Collection
|
||||
public static function getIndexRecommendDoctor(array $fields = ['*']): array|Collection|\Hyperf\Utils\Collection
|
||||
{
|
||||
$params = array();
|
||||
// 状态(0:禁用 1:正常 2:删除)
|
||||
@ -200,7 +198,6 @@ class UserDoctor extends Model
|
||||
->orderBy("is_platform_deep_cooperation", "desc")
|
||||
->orderBy("served_patients_num", "desc")
|
||||
->orderBy("praise_rate", "desc")
|
||||
->limit($limit)
|
||||
->get($fields);
|
||||
|
||||
|
||||
|
||||
57
app/Request/ArticleRequest.php
Normal file
57
app/Request/ArticleRequest.php
Normal file
@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Request;
|
||||
|
||||
use App\Constants\HttpEnumCode;
|
||||
use Hyperf\Validation\Request\FormRequest;
|
||||
|
||||
class ArticleRequest extends FormRequest
|
||||
{
|
||||
protected array $scenes = [
|
||||
'getArticleSciencePage' => [
|
||||
'keyword',
|
||||
'is_top',
|
||||
'source_id',
|
||||
'basic_class_id',
|
||||
],
|
||||
'getArticleScienceList' => [
|
||||
'keyword',
|
||||
'is_top',
|
||||
'source_id',
|
||||
'basic_class_id',
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'is_top' => ['sometimes','numeric','min:0','max:1'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取已定义验证规则的错误消息.
|
||||
*/
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'is_top.required' => HttpEnumCode::getMessage(HttpEnumCode::CLIENT_HTTP_ERROR),
|
||||
'is_top.numeric' => HttpEnumCode::getMessage(HttpEnumCode::CLIENT_HTTP_ERROR),
|
||||
'is_top.min' => HttpEnumCode::getMessage(HttpEnumCode::CLIENT_HTTP_ERROR),
|
||||
'is_top.max' => HttpEnumCode::getMessage(HttpEnumCode::CLIENT_HTTP_ERROR),
|
||||
];
|
||||
}
|
||||
}
|
||||
@ -481,7 +481,7 @@ class PatientDoctorService extends BaseService
|
||||
"be_good_at",
|
||||
];
|
||||
|
||||
$recommend_doctors = UserDoctorModel::getIndexRecommendDoctorLimit(5, $fields);
|
||||
$recommend_doctors = UserDoctorModel::getIndexRecommendDoctor($fields);
|
||||
if (empty($recommend_doctors)) {
|
||||
return success();
|
||||
}
|
||||
@ -652,6 +652,8 @@ class PatientDoctorService extends BaseService
|
||||
$params['history_status'] = 1;
|
||||
$patient_history_doctors = PatientHistoryInquiryModel::getListOrder($params);
|
||||
if (!empty($patient_history_doctors)) {
|
||||
$userDoctorService = new UserDoctorService();
|
||||
|
||||
foreach ($patient_history_doctors as $patient_history_doctor) {
|
||||
if (count($results) >= 5){
|
||||
break;
|
||||
@ -679,14 +681,24 @@ class PatientDoctorService extends BaseService
|
||||
continue;
|
||||
}
|
||||
|
||||
// 获取医生问诊配置
|
||||
$params = array();
|
||||
$params['doctor_id'] = $user_doctor['doctor_id'];
|
||||
$doctor_inquiry_config = DoctorInquiryConfig::getInquiryConfigList($params);
|
||||
if (empty($doctor_inquiry_config)){
|
||||
continue;
|
||||
}
|
||||
|
||||
// 获取医生医院
|
||||
$hospital_name = "";
|
||||
$hospital_level_name = "";
|
||||
if (!empty($user_doctor['hospital_id'])){
|
||||
$params = array();
|
||||
$params['hospital_id'] = $user_doctor['hospital_id'];
|
||||
$hospital = Hospital::getOne($params);
|
||||
if (!empty($hospital)){
|
||||
$hospital_name = $hospital['hospital_name'];
|
||||
$hospital_level_name = $hospital['hospital_level_name'] ?? "";
|
||||
}
|
||||
}
|
||||
|
||||
@ -696,7 +708,9 @@ class PatientDoctorService extends BaseService
|
||||
$data['user_name'] = $user_doctor['user_name'];
|
||||
$data['avatar'] = addAliyunOssWebsite($user_doctor['avatar']);
|
||||
$data['hospital_name'] = $hospital_name;
|
||||
|
||||
$data['hospital_level_name'] = $hospital_level_name;
|
||||
$data['be_good_at'] = $user_doctor['be_good_at'];
|
||||
$data['department_custom_name'] = $user_doctor['department_custom_name'];
|
||||
$data['doctor_title'] = empty($user_doctor['doctor_title']) ? "" : DoctorTitleCode::getMessage($user_doctor['doctor_title']);
|
||||
|
||||
// 按照天来计算,当日为1,前一天为2 未服务过为0
|
||||
@ -709,6 +723,11 @@ class PatientDoctorService extends BaseService
|
||||
// 在线状态
|
||||
$data['is_online'] = $user['is_online'];
|
||||
|
||||
$data['multi_point_status'] = $user_doctor['multi_point_status']; // 医生多点执业认证状态(0:未认证 1:认证通过 2:审核中 3:认证失败)
|
||||
|
||||
// 是否开启问诊购药
|
||||
$data['multi_point_enable'] = $userDoctorService->getDoctorMultiPointEnable("",$doctor_inquiry_config);
|
||||
|
||||
$results[] = $data;
|
||||
|
||||
unset($data);
|
||||
|
||||
@ -11,6 +11,7 @@ declare(strict_types=1);
|
||||
*/
|
||||
|
||||
use App\Controller\AreaController;
|
||||
use App\Controller\ArticleController;
|
||||
use App\Controller\BasicDataController;
|
||||
use App\Controller\CallBackController;
|
||||
use App\Controller\DetectionController;
|
||||
@ -401,6 +402,9 @@ Router::addGroup('/patient', function () {
|
||||
// 获取我的问诊、关注医生列表
|
||||
Router::get('/my', [PatientDoctorController::class, 'getDoctorList']);
|
||||
|
||||
// 获取我历史问诊医生列表
|
||||
Router::get('/history', [PatientDoctorController::class, 'getHistoryDoctorList']);
|
||||
|
||||
// 获取医生评价
|
||||
Router::get('/evaluation/{doctor_id:\d+}', [PatientDoctorController::class, 'getDoctorEvaluationList']);
|
||||
|
||||
@ -620,6 +624,18 @@ Router::addGroup('/patient', function () {
|
||||
// 检测是否可创建服务包问诊订单
|
||||
Router::get('/check/{order_no}', [OrderServicePackageController::class, 'getServicePackageInquiryCheck']);
|
||||
});
|
||||
|
||||
// 文章
|
||||
Router::addGroup('/article', function () {
|
||||
// 科普文章
|
||||
Router::addGroup('/science', function () {
|
||||
// 获取科普文章列表-分页
|
||||
Router::get('', [ArticleController::class, 'getArticleSciencePage']);
|
||||
|
||||
// 获取科普文章列表
|
||||
Router::get('/list', [ArticleController::class, 'getArticleScienceList']);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// 药师端api
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user