合并dev分支,解决冲突
This commit is contained in:
@@ -6,6 +6,9 @@ namespace App\Model;
|
||||
|
||||
|
||||
|
||||
use Hyperf\Database\Model\Builder;
|
||||
use Hyperf\Database\Model\Collection;
|
||||
use Hyperf\DbConnection\Db;
|
||||
use Hyperf\Snowflake\Concern\Snowflake;
|
||||
|
||||
/**
|
||||
@@ -103,4 +106,19 @@ class DoctorAccountDay extends Model
|
||||
{
|
||||
return self::where($params)->decrement($field,$numeral);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取医生账户月份金额
|
||||
* @param array $params
|
||||
* @param array $fields
|
||||
* @return \Hyperf\Collection\Collection
|
||||
*/
|
||||
public static function getDoctorMonth(array $params,array $fields = ['*']): \Hyperf\Collection\Collection
|
||||
{
|
||||
return self::select(['month',Db::raw('SUM(total_amount) AS `total_amount`')])
|
||||
->where($params)
|
||||
->groupBy(['month'])
|
||||
->orderBy('month')
|
||||
->get($fields);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -178,17 +178,19 @@ class OrderInquiry extends Model
|
||||
* 获取医生某一时间段接诊订单分页数据
|
||||
* 已结束
|
||||
* @param array $params
|
||||
* @param array $reception_time 接诊时间区间 ['2023-01-02','2023-01-03']
|
||||
* @param array $reception_time 接诊时间区间 ['2023-01','2023-01']
|
||||
* @param array $inquiry_status_params
|
||||
* @param array $fields
|
||||
* @param int|null $page
|
||||
* @param int|null $per_page
|
||||
* @return int|mixed|string
|
||||
*/
|
||||
public static function getDoctorCreatedDateOrderInquiryPage(array $params, array $reception_time, array $fields = ["*"], int $page = null, ?int $per_page = 10): mixed
|
||||
public static function getDoctorCreatedDateOrderInquiryPage(array $params, array $reception_time, array $inquiry_status_params,array $fields = ["*"], int $page = null, ?int $per_page = 10): mixed
|
||||
{
|
||||
$raw = self::where($params)
|
||||
->whereBetween('created_at', $reception_time)
|
||||
->orderBy('created_at')
|
||||
->whereIn('inquiry_status', $inquiry_status_params)
|
||||
->whereBetween('reception_time', $reception_time)
|
||||
->orderBy('reception_time')
|
||||
->paginate($per_page, $fields, "page", $page);
|
||||
|
||||
$data = array();
|
||||
|
||||
@@ -14,6 +14,9 @@ use Hyperf\Snowflake\Concern\Snowflake;
|
||||
* @property int $patient_id 患者id
|
||||
* @property int $order_inquiry_id 订单-问诊id
|
||||
* @property int $family_id 家庭成员id
|
||||
* @property int $disease_class_id 疾病分类id-系统
|
||||
* @property int $nation_id 民族
|
||||
* @property int $job_id 职业id
|
||||
* @property int $relation 与患者关系(1:本人 2:父母 3:爱人 4:子女 5:亲戚 6:其他 )
|
||||
* @property int $status 状态(1:正常 2:删除)
|
||||
* @property string $name 患者名称
|
||||
@@ -21,7 +24,7 @@ use Hyperf\Snowflake\Concern\Snowflake;
|
||||
* @property int $age 患者年龄
|
||||
* @property string $height 身高(cm)
|
||||
* @property string $weight 体重(kg)
|
||||
* @property int $disease_class_id 疾病分类id-系统
|
||||
* @property int $marital_status 婚姻状况(0:未婚 1:已婚 2:离异)
|
||||
* @property string $disease_class_name 疾病名称-系统
|
||||
* @property string $diagnosis_date 确诊日期
|
||||
* @property string $disease_desc 病情描述(主诉)
|
||||
@@ -33,8 +36,17 @@ use Hyperf\Snowflake\Concern\Snowflake;
|
||||
* @property int $is_pregnant 是否备孕、妊娠、哺乳期(0:否 1:是)
|
||||
* @property string $pregnant 备孕、妊娠、哺乳期描述
|
||||
* @property int $is_taboo 是否服用过禁忌药物,且无相关禁忌(0:否 1:是)问诊购药时存在
|
||||
* @property int $nation_id 民族
|
||||
* @property int $is_take_medicine 正在服药(0:否 1:是)
|
||||
* @property string $drugs_name 正在服药名称
|
||||
* @property string $nation_name 民族名称
|
||||
* @property string $job_name 职业名称
|
||||
* @property string $diagnosis_hospital 确诊医院
|
||||
* @property int $is_operation 是否存在手术(0:否 1:是)
|
||||
* @property string $operation 手术描述
|
||||
* @property int $drink_wine_status 饮酒状态(1:从不 2:偶尔 3:经常 4:每天 5:已戒酒)
|
||||
* @property int $smoke_status 吸烟状态(1:从不 2:偶尔 3:经常 4:每天 5:已戒烟)
|
||||
* @property int $chemical_compound_status 化合物状态(1:从不 2:偶尔 3:经常 4:每天)
|
||||
* @property string $chemical_compound_describe 化合物描述
|
||||
* @property \Carbon\Carbon $created_at 创建时间
|
||||
* @property \Carbon\Carbon $updated_at 修改时间
|
||||
* @property-read BasicJob|null $BasicJob
|
||||
@@ -53,7 +65,7 @@ class OrderInquiryCase extends Model
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected array $fillable = ['inquiry_case_id', 'user_id', 'patient_id', 'order_inquiry_id', 'family_id', 'relation', 'status', 'name', 'sex', 'age', 'height', 'weight', 'disease_class_id', 'disease_class_name', 'diagnosis_date', 'disease_desc', 'diagnose_images', 'is_allergy_history', 'allergy_history', 'is_family_history', 'family_history', 'is_pregnant', 'pregnant', 'is_taboo', 'nation_id', 'nation_name', 'created_at', 'updated_at'];
|
||||
protected array $fillable = ['inquiry_case_id', 'user_id', 'patient_id', 'order_inquiry_id', 'family_id', 'disease_class_id', 'nation_id', 'job_id', 'relation', 'status', 'name', 'sex', 'age', 'height', 'weight', 'marital_status', 'disease_class_name', 'diagnosis_date', 'disease_desc', 'diagnose_images', 'is_allergy_history', 'allergy_history', 'is_family_history', 'family_history', 'is_pregnant', 'pregnant', 'is_taboo', 'is_take_medicine', 'drugs_name', 'nation_name', 'job_name', 'diagnosis_hospital', 'is_operation', 'operation', 'drink_wine_status', 'smoke_status', 'chemical_compound_status', 'chemical_compound_describe', 'created_at', 'updated_at'];
|
||||
|
||||
protected string $primaryKey = "inquiry_case_id";
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ namespace App\Model;
|
||||
|
||||
|
||||
use Hyperf\Database\Model\Collection;
|
||||
use Hyperf\Database\Model\Relations\HasOne;
|
||||
use Hyperf\Snowflake\Concern\Snowflake;
|
||||
|
||||
/**
|
||||
|
||||
@@ -67,6 +67,22 @@ class PatientFollow extends Model
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 远程关联用户表
|
||||
* @return HasOneThrough
|
||||
*/
|
||||
public function User(): HasOneThrough
|
||||
{
|
||||
return $this->hasOneThrough(
|
||||
User::class,
|
||||
UserDoctor::class,
|
||||
"doctor_id",
|
||||
"user_id",
|
||||
"doctor_id",
|
||||
"user_id",
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取是否存在
|
||||
* @param array $params
|
||||
@@ -109,8 +125,9 @@ class PatientFollow extends Model
|
||||
$query = self::with([
|
||||
'DoctorExpertise:doctor_expertise_id,doctor_id,expertise_id',
|
||||
'DoctorExpertise.DiseaseClassExpertise:expertise_id,expertise_name',
|
||||
"UserDoctor:doctor_id,user_name,avatar,doctor_title,hospital_id,multi_point_status,department_custom_name,be_good_at",
|
||||
"UserDoctor.Hospital:hospital_id,hospital_name,hospital_level_name"
|
||||
"UserDoctor:doctor_id,user_id,user_name,avatar,doctor_title,hospital_id,multi_point_status,department_custom_name,be_good_at",
|
||||
"UserDoctor.Hospital:hospital_id,hospital_name,hospital_level_name",
|
||||
"UserDoctor.User:user_id,is_online"
|
||||
])
|
||||
->where($params)
|
||||
->paginate($per_page, $fields, "page", $page);
|
||||
|
||||
@@ -66,6 +66,22 @@ class PatientHistoryInquiry extends Model
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 远程关联用户表
|
||||
* @return HasOneThrough
|
||||
*/
|
||||
public function User(): HasOneThrough
|
||||
{
|
||||
return $this->hasOneThrough(
|
||||
User::class,
|
||||
UserDoctor::class,
|
||||
"doctor_id",
|
||||
"user_id",
|
||||
"doctor_id",
|
||||
"user_id",
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 关联医生专长表
|
||||
* @return HasMany
|
||||
@@ -191,8 +207,9 @@ class PatientHistoryInquiry extends Model
|
||||
$query = self::with([
|
||||
'DoctorExpertise:doctor_expertise_id,doctor_id,expertise_id',
|
||||
'DoctorExpertise.DiseaseClassExpertise:expertise_id,expertise_name',
|
||||
"UserDoctor:doctor_id,user_name,avatar,doctor_title,hospital_id,multi_point_status,department_custom_name,be_good_at",
|
||||
"UserDoctor.Hospital:hospital_id,hospital_name,hospital_level_name"
|
||||
"UserDoctor:doctor_id,user_id,user_name,avatar,doctor_title,hospital_id,multi_point_status,department_custom_name,be_good_at",
|
||||
"UserDoctor.Hospital:hospital_id,hospital_name,hospital_level_name",
|
||||
"UserDoctor.User:user_id,is_online"
|
||||
])
|
||||
->where($params)
|
||||
->groupBy('doctor_id')
|
||||
|
||||
@@ -0,0 +1,168 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Model;
|
||||
|
||||
|
||||
|
||||
use Hyperf\Database\Model\Collection;
|
||||
use Hyperf\Database\Model\Relations\HasOne;
|
||||
use Hyperf\DbConnection\Db;
|
||||
use Hyperf\Snowflake\Concern\Snowflake;
|
||||
|
||||
/**
|
||||
* @property int $pathography_id 主键id
|
||||
* @property int $user_id 用户id
|
||||
* @property int $patient_id 患者id
|
||||
* @property int $family_id 家庭成员id
|
||||
* @property int $order_inquiry_id 关联问诊id
|
||||
* @property int $order_prescription_id 关联处方id
|
||||
* @property int $disease_class_id 疾病分类id-系统
|
||||
* @property int $nation_id 民族id
|
||||
* @property int $job_id 职业id
|
||||
* @property int $relation 患者关系(1:本人 2:父母 3:爱人 4:子女 5:亲戚 6:其他 )
|
||||
* @property int $status 状态(1:正常 2:删除)
|
||||
* @property string $name 患者名称
|
||||
* @property int $sex 患者性别(0:未知 1:男 2:女)
|
||||
* @property int $age 患者年龄
|
||||
* @property string $height 身高(cm)
|
||||
* @property string $weight 体重(kg)
|
||||
* @property int $marital_status 婚姻状况(0:未婚 1:已婚 2:离异)
|
||||
* @property string $disease_class_name 疾病名称-系统
|
||||
* @property string $diagnosis_date 确诊日期
|
||||
* @property string $disease_desc 病情描述(主诉)
|
||||
* @property string $diagnose_images 复诊凭证(多个使用逗号分隔)
|
||||
* @property int $is_allergy_history 是否存在过敏史(0:否 1:是)
|
||||
* @property string $allergy_history 过敏史描述
|
||||
* @property int $is_family_history 是否存在家族病史(0:否 1:是)
|
||||
* @property string $family_history 家族病史描述
|
||||
* @property int $is_pregnant 是否备孕、妊娠、哺乳期(0:否 1:是)
|
||||
* @property string $pregnant 备孕、妊娠、哺乳期描述
|
||||
* @property int $is_taboo 是否服用过禁忌药物,且无相关禁忌(0:否 1:是)问诊购药时存在
|
||||
* @property int $is_take_medicine 正在服药(0:否 1:是)
|
||||
* @property string $drugs_name 正在服药名称
|
||||
* @property string $nation_name 民族名称
|
||||
* @property string $job_name 职业名称
|
||||
* @property string $diagnosis_hospital 确诊医院
|
||||
* @property int $is_operation 是否存在手术(0:否 1:是)
|
||||
* @property string $operation 手术描述
|
||||
* @property int $drink_wine_status 饮酒状态(1:从不 2:偶尔 3:经常 4:每天 5:已戒酒)
|
||||
* @property int $smoke_status 吸烟状态(1:从不 2:偶尔 3:经常 4:每天 5:已戒烟)
|
||||
* @property int $chemical_compound_status 化合物状态(1:从不 2:偶尔 3:经常 4:每天)
|
||||
* @property string $chemical_compound_describe 化合物描述
|
||||
* @property \Carbon\Carbon $created_at 创建时间
|
||||
* @property \Carbon\Carbon $updated_at 修改时间
|
||||
* @property-read OrderInquiry|null $OrderInquiry
|
||||
*/
|
||||
class PatientPathography extends Model
|
||||
{
|
||||
use Snowflake;
|
||||
|
||||
/**
|
||||
* The table associated with the model.
|
||||
*/
|
||||
protected ?string $table = 'patient_pathography';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected array $fillable = ['pathography_id', 'user_id', 'patient_id', 'family_id', 'order_inquiry_id', 'order_prescription_id', 'disease_class_id', 'nation_id', 'job_id', 'relation', 'status', 'name', 'sex', 'age', 'height', 'weight', 'marital_status', 'disease_class_name', 'diagnosis_date', 'disease_desc', 'diagnose_images', 'is_allergy_history', 'allergy_history', 'is_family_history', 'family_history', 'is_pregnant', 'pregnant', 'is_taboo', 'is_take_medicine', 'drugs_name', 'nation_name', 'job_name', 'diagnosis_hospital', 'is_operation', 'operation', 'drink_wine_status', 'smoke_status', 'chemical_compound_status', 'chemical_compound_describe', 'created_at', 'updated_at'];
|
||||
|
||||
protected string $primaryKey = "pathography_id";
|
||||
|
||||
/**
|
||||
* 关联问诊订单表
|
||||
*/
|
||||
public function OrderInquiry(): HasOne
|
||||
{
|
||||
return $this->hasOne(OrderInquiry::class, 'order_inquiry_id', 'order_inquiry_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 getLastOne(array $params, array $fields = ['*']): object|null
|
||||
{
|
||||
return self::where($params)->latest("created_at")->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|PatientPathography
|
||||
*/
|
||||
public static function addPatientPathography(array $data): \Hyperf\Database\Model\Model|PatientPathography
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取家庭成员病情记录列表-分页
|
||||
* @param array $params
|
||||
* @param array $fields
|
||||
* @param int|null $page
|
||||
* @param int|null $per_page
|
||||
* @return array
|
||||
*/
|
||||
public static function getPatientPathographyPage(array $params,array $fields = ["*"], int $page = null, ?int $per_page = 10): array
|
||||
{
|
||||
$result = self::with(['OrderInquiry'])
|
||||
->where($params)
|
||||
->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;
|
||||
}
|
||||
|
||||
// 获取信息-分组
|
||||
public static function getFamilyPathographyGroup(array $params, array $fields = ['*']): object|null
|
||||
{
|
||||
return self::where($params)
|
||||
->groupBy(["family_id"])
|
||||
->get($fields);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Model;
|
||||
|
||||
|
||||
|
||||
use Hyperf\Database\Model\Collection;
|
||||
use Hyperf\Snowflake\Concern\Snowflake;
|
||||
|
||||
/**
|
||||
* @property int $pathography_product_id 主键id
|
||||
* @property int $pathography_id 病情记录id
|
||||
* @property int $product_id 商品id
|
||||
* @property int $case_product_num 药品数量
|
||||
* @property \Carbon\Carbon $created_at 创建时间
|
||||
* @property \Carbon\Carbon $updated_at 修改时间
|
||||
*/
|
||||
class PatientPathographyProduct extends Model
|
||||
{
|
||||
use Snowflake;
|
||||
|
||||
/**
|
||||
* The table associated with the model.
|
||||
*/
|
||||
protected ?string $table = 'patient_pathography_product';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected array $fillable = ['pathography_product_id', 'pathography_id', 'product_id', 'case_product_num', 'created_at', 'updated_at'];
|
||||
|
||||
protected string $primaryKey = "pathography_product_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|PatientPathographyProduct
|
||||
*/
|
||||
public static function addPatientPathographyProduct(array $data): \Hyperf\Database\Model\Model|PatientPathographyProduct
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -13,6 +13,9 @@ use Hyperf\Snowflake\Concern\Snowflake;
|
||||
/**
|
||||
* @property int $product_id 主键id
|
||||
* @property int $product_platform_id 处方平台商品id
|
||||
* @property int $product_status 商品状态(1:正常 2:下架)
|
||||
* @property int $is_delete 是否删除(0:否 1:是)
|
||||
* @property int $prescription_num 处方可开具的数量
|
||||
* @property string $product_name 商品名称
|
||||
* @property string $common_name 商品通用名
|
||||
* @property string $product_price 商品价格
|
||||
@@ -32,6 +35,7 @@ use Hyperf\Snowflake\Concern\Snowflake;
|
||||
* @property string $product_remarks 商品备注
|
||||
* @property \Carbon\Carbon $created_at 创建时间
|
||||
* @property \Carbon\Carbon $updated_at 修改时间
|
||||
* @property-read ProductPlatformAmount|null $ProductPlatformAmount
|
||||
*/
|
||||
class Product extends Model
|
||||
{
|
||||
@@ -45,7 +49,7 @@ class Product extends Model
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected array $fillable = ['product_id', 'product_platform_id', 'product_name', 'common_name', 'product_price', 'mnemonic_code', 'product_type', 'product_platform_code', 'product_pharmacy_code', 'product_cover_img', 'product_spec', 'license_number', 'manufacturer', 'single_unit', 'single_use', 'packaging_unit', 'frequency_use', 'available_days', 'product_remarks', 'created_at', 'updated_at'];
|
||||
protected array $fillable = ['product_id', 'product_platform_id', 'product_status', 'is_delete', 'prescription_num', 'product_name', 'common_name', 'product_price', 'mnemonic_code', 'product_type', 'product_platform_code', 'product_pharmacy_code', 'product_cover_img', 'product_spec', 'license_number', 'manufacturer', 'single_unit', 'single_use', 'packaging_unit', 'frequency_use', 'available_days', 'product_remarks', 'created_at', 'updated_at'];
|
||||
|
||||
protected string $primaryKey = "product_id";
|
||||
|
||||
|
||||
@@ -15,11 +15,16 @@ use Hyperf\Snowflake\Concern\Snowflake;
|
||||
* @property int $order_inquiry_id 订单-问诊id
|
||||
* @property int $order_prescription_id 订单-处方表id(无需上报处方时为null)
|
||||
* @property int $order_product_id 订单-商品表id(无需上报处方时为null)
|
||||
* @property int $report_inquiry_status 问诊上报状态(0:未上报 1:已上报 2:上报失败)
|
||||
* @property int $report_inquiry_int 问诊上报次数
|
||||
* @property int $report_inquiry_type 问诊上报类型(1:网络初诊 2:网络复诊)
|
||||
* @property string $report_inquiry_time 问诊上报时间
|
||||
* @property string $report_inquiry_fail_reason 问诊上报失败原因
|
||||
* @property int $report_consult_status 上报网络咨询状态(0:未上报 1:已上报 2:上报失败)
|
||||
* @property int $report_consult_int 网络咨询上报次数
|
||||
* @property string $report_consult_time 网络咨询上报时间
|
||||
* @property string $report_consult_fail_reason 网络咨询上报失败原因
|
||||
* @property int $is_further_consult 是否需要上报网络复诊(0:否 1:是)
|
||||
* @property int $report_further_consult_status 上报网络复诊状态(0:未上报 1:已上报 2:上报失败)
|
||||
* @property int $report_further_consult_int 网络复诊上报次数
|
||||
* @property string $report_further_consult_time 网络复诊上报时间
|
||||
* @property string $report_further_consult_fail_reason 网络复诊上报失败原因
|
||||
* @property int $is_prescription 是否需要上报处方(0:否 1:是)
|
||||
* @property int $report_prescription_status 处方上报状态(0:未上报 1:已上报 2:上报失败)
|
||||
* @property int $report_prescription_int 处方上报次数
|
||||
* @property string $report_prescription_time 处方上报时间
|
||||
@@ -39,11 +44,10 @@ class ReportRegulatory extends Model
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected array $fillable = ['report_regulatory_id', 'order_inquiry_id', 'order_prescription_id', 'order_product_id', 'report_inquiry_status', 'report_inquiry_int', 'report_inquiry_type', 'report_inquiry_time', 'report_inquiry_fail_reason', 'report_prescription_status', 'report_prescription_int', 'report_prescription_time', 'report_prescription_fail_reason', 'created_at', 'updated_at'];
|
||||
protected array $fillable = ['report_regulatory_id', 'order_inquiry_id', 'order_prescription_id', 'order_product_id', 'report_consult_status', 'report_consult_int', 'report_consult_time', 'report_consult_fail_reason', 'is_further_consult', 'report_further_consult_status', 'report_further_consult_int', 'report_further_consult_time', 'report_further_consult_fail_reason', 'is_prescription', 'report_prescription_status', 'report_prescription_int', 'report_prescription_time', 'report_prescription_fail_reason', 'created_at', 'updated_at'];
|
||||
|
||||
protected string $primaryKey = "report_regulatory_id";
|
||||
|
||||
|
||||
/**
|
||||
* 获取信息-单条
|
||||
* @param array $params
|
||||
@@ -117,18 +121,36 @@ class ReportRegulatory extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表
|
||||
* 检测是否存在
|
||||
* @param array $params
|
||||
* @param array $or_params
|
||||
* @return bool
|
||||
*/
|
||||
public static function getExists(array $params): bool
|
||||
{
|
||||
return self::where($params)->exists();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取未上报监管平台列表
|
||||
* @param array $fields
|
||||
* @return Collection|array
|
||||
*/
|
||||
public static function getNotReportList(array $params = [],array $fields = ["*"]): Collection|array
|
||||
public static function getNotReportList(array $fields = ["*"]): Collection|array
|
||||
{
|
||||
return self::where($params)
|
||||
->Where(function ($query) {
|
||||
$query->orWhere('report_inquiry_status','!=',1);
|
||||
$query->orWhere('report_prescription_status','!=',1);
|
||||
return self::orWhere(function ($query) {
|
||||
$query->Where('is_further_consult','=',1);
|
||||
$query->Where('report_further_consult_status','!=',1);
|
||||
$query->Where('report_further_consult_int','<',5);
|
||||
})
|
||||
->orWhere(function ($query) {
|
||||
$query->Where('is_prescription','=',1);
|
||||
$query->Where('report_prescription_status','!=',1);
|
||||
$query->Where('report_prescription_int','<',5);
|
||||
})
|
||||
->orWhere(function ($query) {
|
||||
$query->Where('report_consult_status','!=',1);
|
||||
$query->Where('report_consult_int','<',5);
|
||||
})
|
||||
->get($fields);
|
||||
}
|
||||
|
||||
+5
-3
@@ -23,9 +23,11 @@ use Hyperf\Snowflake\Concern\Snowflake;
|
||||
* @property int $age 年龄
|
||||
* @property int $sex 性别(0:未知 1:男 2:女)
|
||||
* @property string $avatar 头像
|
||||
* @property int $is_online 是否在线(0:不在线 1:在线)
|
||||
* @property string $login_at 小程序登陆时间
|
||||
* @property string $im_login_at im登陆时间
|
||||
* @property string $login_ip 登陆ip
|
||||
* @property string $last_login_at 最后登陆时间
|
||||
* @property string $created_by 创建者id(后台用户表id null:自己注册)
|
||||
* @property string $created_by 创建者id(后台用户表id,前台用户表id)
|
||||
* @property \Carbon\Carbon $created_at 创建时间
|
||||
* @property \Carbon\Carbon $updated_at 修改时间
|
||||
*/
|
||||
@@ -41,7 +43,7 @@ class User extends Model
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected array $fillable = ['user_id', 'user_name', 'user_account', 'mobile', 'wx_mobile', 'user_password', 'salt', 'user_type', 'user_status', 'register_method', 'age', 'sex', 'avatar', 'login_ip', 'last_login_at', 'created_by', 'created_at', 'updated_at'];
|
||||
protected array $fillable = ['user_id', 'user_name', 'user_account', 'mobile', 'wx_mobile', 'user_password', 'salt', 'user_type', 'user_status', 'register_method', 'age', 'sex', 'avatar', 'is_online', 'login_at', 'im_login_at', 'login_ip', 'created_by', 'created_at', 'updated_at'];
|
||||
|
||||
protected string $primaryKey = "user_id";
|
||||
|
||||
|
||||
+91
-125
@@ -32,7 +32,7 @@ use Hyperf\Utils\Arr;
|
||||
* @property int $is_bind_bank 是否已绑定结算银行卡(0:否 1:是)
|
||||
* @property int $is_recommend 是否首页推荐(0:否 1:是)
|
||||
* @property string $avatar 头像
|
||||
* @property int $doctor_title 医生职称(1:主任中医师 2:主任医师 3:副主任中医师 4:副主任医师 5:主治医师 6:住院医师)
|
||||
* @property int $doctor_title 医生职称(1:主任医师 2:主任中医师 3:副主任医师 4:副主任中医师 5:主治医师 6:住院医师)
|
||||
* @property int $department_custom_id 科室id-自定义
|
||||
* @property string $department_custom_name 科室名称(如未自己输入,填入标准科室名称)
|
||||
* @property string $department_custom_mobile 科室电话
|
||||
@@ -41,21 +41,21 @@ use Hyperf\Utils\Arr;
|
||||
* @property string $praise_rate 好评率(百分制。订单平均评价中超过4-5分的订单总数 / 总订单数 * 5)
|
||||
* @property string $avg_response_time 平均响应时间(分钟制)
|
||||
* @property int $number_of_fans 被关注数量
|
||||
* @property int $is_online 是否在线(0:不在线 1:在线)
|
||||
* @property int $is_img_expert_reception 是否参加专家图文接诊(0:否 1:是)
|
||||
* @property int $is_img_welfare_reception 是否参加公益图文问诊(0:否 1:是)
|
||||
* @property int $is_img_quick_reception 是否参加快速图文接诊(0:否 1:是)
|
||||
* @property int $is_platform_deep_cooperation 是否平台深度合作医生(0:否 1:是)
|
||||
* @property int $is_enterprise_deep_cooperation 是否企业深度合作医生(0:否 1:是)
|
||||
* @property int $is_sys_diagno_cooperation 是否先思达合作医生(0:否 1:是)
|
||||
* @property string $qr_code 分享二维码
|
||||
* @property string $be_good_at 擅长
|
||||
* @property string $brief_introduction 医生简介
|
||||
* @property \Carbon\Carbon $created_at 创建时间
|
||||
* @property \Carbon\Carbon $updated_at 修改时间
|
||||
* @property-read \Hyperf\Database\Model\Collection|DoctorExpertise[] $DoctorExpertise
|
||||
* @property-read \Hyperf\Database\Model\Collection|DoctorInquiryConfig[] $DoctorInquiryConfig
|
||||
* @property-read Hospital $Hospital
|
||||
* @property-read \Hyperf\Database\Model\Collection|OrderInquiry[] $OrderInquiry
|
||||
* @property-read \Hyperf\Database\Model\Collection|DoctorExpertise[]|null $DoctorExpertise
|
||||
* @property-read \Hyperf\Database\Model\Collection|DoctorInquiryConfig[]|null $DoctorInquiryConfig
|
||||
* @property-read Hospital|null $Hospital
|
||||
* @property-read \Hyperf\Database\Model\Collection|OrderInquiry[]|null $OrderInquiry
|
||||
*/
|
||||
class UserDoctor extends Model
|
||||
{
|
||||
@@ -69,7 +69,7 @@ class UserDoctor extends Model
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected array $fillable = ['doctor_id', 'user_id', 'user_name', 'open_id', 'union_id', 'wx_session_key', 'status', 'idcard_status', 'iden_auth_status', 'iden_auth_time', 'iden_auth_fail_reason', 'multi_point_status', 'multi_point_time', 'multi_point_fail_reason', 'is_bind_bank', 'is_recommend', 'avatar', 'doctor_title', 'department_custom_id', 'department_custom_name', 'department_custom_mobile', 'hospital_id', 'served_patients_num', 'praise_rate', 'avg_response_time', 'number_of_fans', 'is_online', 'is_img_expert_reception', 'is_img_welfare_reception', 'is_img_quick_reception', 'is_platform_deep_cooperation', 'is_enterprise_deep_cooperation', 'qr_code', 'be_good_at', 'brief_introduction', 'created_at', 'updated_at'];
|
||||
protected array $fillable = ['doctor_id', 'user_id', 'user_name', 'open_id', 'union_id', 'wx_session_key', 'status', 'idcard_status', 'iden_auth_status', 'iden_auth_time', 'iden_auth_fail_reason', 'multi_point_status', 'multi_point_time', 'multi_point_fail_reason', 'is_bind_bank', 'is_recommend', 'avatar', 'doctor_title', 'department_custom_id', 'department_custom_name', 'department_custom_mobile', 'hospital_id', 'served_patients_num', 'praise_rate', 'avg_response_time', 'number_of_fans', 'is_img_expert_reception', 'is_img_welfare_reception', 'is_img_quick_reception', 'is_platform_deep_cooperation', 'is_enterprise_deep_cooperation', 'is_sys_diagno_cooperation', 'qr_code', 'be_good_at', 'brief_introduction', 'created_at', 'updated_at'];
|
||||
|
||||
protected string $primaryKey = "doctor_id";
|
||||
|
||||
@@ -81,6 +81,14 @@ class UserDoctor extends Model
|
||||
return $this->hasOne(Hospital::class, 'hospital_id', 'hospital_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* 关联用户表
|
||||
*/
|
||||
public function User(): HasOne
|
||||
{
|
||||
return $this->hasOne(User::class, 'user_id', 'user_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* 关联问诊配置表(一对多)
|
||||
* @return HasMany
|
||||
@@ -108,13 +116,6 @@ class UserDoctor extends Model
|
||||
return $this->hasMany(OrderInquiry::class, "doctor_id", "doctor_id");
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 关联职称表
|
||||
// */
|
||||
// public function BasicDoctorTitle(): HasOne
|
||||
// {
|
||||
// return $this->hasOne(BasicDoctorTitle::class, 'doctor_title_id', 'doctor_title_id');
|
||||
// }
|
||||
|
||||
/**
|
||||
* 获取医生信息-单条
|
||||
@@ -180,8 +181,8 @@ class UserDoctor extends Model
|
||||
// 身份认证状态(0:未认证 1:认证通过 2:审核中 3:认证失败)
|
||||
$params["iden_auth_status"] = 1;
|
||||
|
||||
// 是否在线(0:不在线 1:在线)
|
||||
$params["is_online"] = 1;
|
||||
// // 是否在线(0:不在线 1:在线)
|
||||
// $params["is_online"] = 1;
|
||||
|
||||
// // 是否参加专家图文接诊(0:否 1:是)
|
||||
// $params["is_img_expert_reception"] = 1;
|
||||
@@ -189,6 +190,7 @@ class UserDoctor extends Model
|
||||
$datas = self::with([
|
||||
'Hospital:hospital_id,hospital_name,hospital_level_name',
|
||||
"DoctorInquiryConfig",
|
||||
"User"
|
||||
])
|
||||
->where($params)
|
||||
->orderBy("is_recommend", "desc")
|
||||
@@ -202,108 +204,6 @@ class UserDoctor extends Model
|
||||
return $datas;
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 获取问诊医生列表
|
||||
// * 专家问诊-公益问诊共用
|
||||
// * @param string $keyword
|
||||
// * @param array $hospital_params 医院搜索条件
|
||||
// * @param array $doctor_params 医生搜索条件
|
||||
// * @param array $doctor_expertise_params
|
||||
// * @param string|int $sort_order
|
||||
// * @param array $fields
|
||||
// * @param int|null $page
|
||||
// * @param int|null $per_page
|
||||
// * @return array
|
||||
// */
|
||||
// public static function getInquiryDoctorPage(string $keyword = "", array $hospital_params = [], array $doctor_params = [], array $doctor_expertise_params = [], string|int $sort_order = 1, array $fields = ["*"], int $page = null, ?int $per_page = 10): array
|
||||
// {
|
||||
// $query = self::with([
|
||||
// "Hospital:hospital_id,hospital_name,hospital_status,hospital_level_name,province_id,city_id",
|
||||
// "DoctorExpertise",
|
||||
// "DoctorInquiryConfig" => function ($query) use ($sort_order) {
|
||||
// $query->whereIn('inquiry_type', [1, 3])
|
||||
// ->where('inquiry_mode', 1);
|
||||
// },
|
||||
// ])
|
||||
// ->where($doctor_params)
|
||||
// ->when($keyword, function ($query, $keyword) {
|
||||
// $query->where(function ($query) use ($keyword) {
|
||||
// $query->orwhere("user_name", 'like', '%' . $keyword . '%');
|
||||
// $query->orwhere("department_custom_name", 'like', '%' . $keyword . '%');
|
||||
// $query->orWhereHas('Hospital', function ($query) use ($keyword) {
|
||||
// $query->where('hospital_name', 'like', '%' . $keyword . '%');
|
||||
// });
|
||||
// });
|
||||
// })
|
||||
// ->whereHas('Hospital', function ($query) use ($hospital_params) {
|
||||
// $query->where($hospital_params);
|
||||
// })
|
||||
// ->whereHas('DoctorExpertise', function ($query) use ($doctor_expertise_params) {
|
||||
// $query->where($doctor_expertise_params);
|
||||
// })
|
||||
// ->whereHas('DoctorInquiryConfig', function ($query) {
|
||||
// $params = array();
|
||||
// $params['inquiry_mode'] = 1;// 接诊方式:图文
|
||||
// $query->where($params)->whereIn('inquiry_type', [1, 3]);
|
||||
// });
|
||||
//
|
||||
// if (!empty($sort_order)){
|
||||
// if (in_array($sort_order,[1,3,4])){
|
||||
// $query = $query->join('doctor_inquiry_config', function ($query) {
|
||||
// $query->on('user_doctor.doctor_id', '=', 'doctor_inquiry_config.doctor_id')
|
||||
// ->whereIn('inquiry_type', [1, 3])
|
||||
// ->where('inquiry_mode', 1)
|
||||
// ->orderBy('inquiry_price', 'desc')
|
||||
// ->take(1);
|
||||
// })
|
||||
// ->select("user_doctor.*")
|
||||
// ->groupBy("user_doctor.doctor_id");
|
||||
// }
|
||||
//
|
||||
// if ($sort_order == 1) {
|
||||
// // 综合-价格从低到高
|
||||
// $query->orderBy('is_recommend', 'desc');// 是否首页推荐(0:否 1:是)
|
||||
// $query->orderByRaw('avg_response_time = 0 ASC');
|
||||
// $query->orderBy('avg_response_time');
|
||||
// $query->orderBy('served_patients_num', 'desc');// 服务数从多到少
|
||||
// $query->orderBy(Db::raw("convert(substr(user_name,1,1) using `GBK`)"), 'asc');// 名称排名
|
||||
// $query->orderBy('doctor_inquiry_config.inquiry_price', 'asc');
|
||||
// } elseif ($sort_order == 2) {
|
||||
// // 响应时间快
|
||||
// $query->orderByRaw('avg_response_time = 0 ASC');
|
||||
// $query->orderBy('avg_response_time');
|
||||
// $query->orderBy(Db::raw("convert(substr(user_name,1,1) using `GBK`)"), 'asc');// 名称排名
|
||||
// } elseif ($sort_order == 3) {
|
||||
// // 价格从低到高
|
||||
// $query->orderBy('doctor_inquiry_config.inquiry_price', 'asc');
|
||||
// $query->orderByRaw('avg_response_time = 0 ASC');
|
||||
// $query->orderBy('avg_response_time');
|
||||
// $query->orderBy(Db::raw("convert(substr(user_name,1,1) using `GBK`)"), 'asc');// 名称排名
|
||||
// } elseif ($sort_order == 4) {
|
||||
// // 价格从高到低
|
||||
// $query->orderBy('doctor_inquiry_config.inquiry_price', 'desc');
|
||||
// $query->orderByRaw('avg_response_time = 0 ASC');
|
||||
// $query->orderBy('avg_response_time');
|
||||
// $query->orderBy(Db::raw("convert(substr(user_name,1,1) using `GBK`)"), 'asc');// 名称排名
|
||||
// } elseif ($sort_order == 5) {
|
||||
// // 服务数从多到少
|
||||
// $query->orderBy('served_patients_num', 'desc');
|
||||
// $query->orderBy(Db::raw("convert(substr(user_name,1,1) using `GBK`)"), 'asc');// 名称排名
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// $result = $query->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;
|
||||
// }
|
||||
|
||||
/**
|
||||
* 获取问诊医生列表
|
||||
* 专家问诊-公益问诊共用
|
||||
@@ -312,13 +212,14 @@ class UserDoctor extends Model
|
||||
* @param array $doctor_params 医生搜索条件
|
||||
* @param array $doctor_expertise_params
|
||||
* @param int $is_search_welfare_reception 是否搜索公益问诊
|
||||
* @param string|int $is_first_online 是否优先在线(1:是)
|
||||
* @param string|int $sort_order
|
||||
* @param array $fields
|
||||
* @param int|null $page
|
||||
* @param int|null $per_page
|
||||
* @return array
|
||||
*/
|
||||
public static function getInquiryDoctorPage(string $keyword = "", array $hospital_params = [], array $doctor_params = [], array $doctor_expertise_params = [],int $is_search_welfare_reception = 0, string|int $sort_order = 1, array $fields = ["*"], int $page = null, ?int $per_page = 10): array
|
||||
public static function getInquiryDoctorPage(string $keyword = "", array $hospital_params = [], array $doctor_params = [], array $doctor_expertise_params = [],int $is_search_welfare_reception = 0,string|int $is_first_online = 0, string|int $sort_order = 1, array $fields = ["*"], int $page = null, ?int $per_page = 10): array
|
||||
{
|
||||
$query = self::with([
|
||||
"Hospital:hospital_id,hospital_name,hospital_status,hospital_level_name,province_id,city_id",
|
||||
@@ -330,6 +231,7 @@ class UserDoctor extends Model
|
||||
$query->where('is_enable', 1);
|
||||
}
|
||||
},
|
||||
"User:user_id,is_online"
|
||||
])
|
||||
->where($doctor_params)
|
||||
->when($keyword, function ($query, $keyword) {
|
||||
@@ -353,7 +255,7 @@ class UserDoctor extends Model
|
||||
if (!empty($is_search_welfare_reception)){
|
||||
$params['is_enable'] = 1;
|
||||
}
|
||||
|
||||
|
||||
$query->where($params);
|
||||
|
||||
if (!empty($is_search_welfare_reception)){
|
||||
@@ -361,6 +263,14 @@ class UserDoctor extends Model
|
||||
}
|
||||
});
|
||||
|
||||
if ($is_first_online == 1){
|
||||
$query->join('user as u', function ($query) {
|
||||
$query->on('user_doctor.user_id', '=', 'u.user_id');
|
||||
})
|
||||
->select("user_doctor.*")
|
||||
->orderBy('u.is_online', 'desc');
|
||||
}
|
||||
|
||||
if (!empty($sort_order)){
|
||||
if (in_array($sort_order,[1,3,4])){
|
||||
$query = $query->join('doctor_inquiry_config', function ($query) {
|
||||
@@ -380,29 +290,29 @@ class UserDoctor extends Model
|
||||
$query->orderByRaw('avg_response_time = 0 ASC');
|
||||
$query->orderBy('avg_response_time');
|
||||
$query->orderBy('served_patients_num', 'desc');// 服务数从多到少
|
||||
$query->orderBy(Db::raw("convert(substr(user_name,1,1) using `GBK`)"), 'asc');// 名称排名
|
||||
$query->orderBy(Db::raw("convert(substr(gdxz_user_doctor.user_name,1,1) using `GBK`)"), 'asc');// 名称排名
|
||||
$query->orderBy('doctor_inquiry_config.inquiry_price', 'asc');
|
||||
} elseif ($sort_order == 2) {
|
||||
// 响应时间快
|
||||
$query->orderByRaw('avg_response_time = 0 ASC');
|
||||
$query->orderBy('avg_response_time');
|
||||
$query->orderBy(Db::raw("convert(substr(user_name,1,1) using `GBK`)"), 'asc');// 名称排名
|
||||
$query->orderBy(Db::raw("convert(substr(gdxz_user_doctor.user_name,1,1) using `GBK`)"), 'asc');// 名称排名
|
||||
} elseif ($sort_order == 3) {
|
||||
// 价格从低到高
|
||||
$query->orderBy('doctor_inquiry_config.inquiry_price', 'asc');
|
||||
$query->orderByRaw('avg_response_time = 0 ASC');
|
||||
$query->orderBy('avg_response_time');
|
||||
$query->orderBy(Db::raw("convert(substr(user_name,1,1) using `GBK`)"), 'asc');// 名称排名
|
||||
$query->orderBy(Db::raw("convert(substr(gdxz_user_doctor.user_name,1,1) using `GBK`)"), 'asc');// 名称排名
|
||||
} elseif ($sort_order == 4) {
|
||||
// 价格从高到低
|
||||
$query->orderBy('doctor_inquiry_config.inquiry_price', 'desc');
|
||||
$query->orderByRaw('avg_response_time = 0 ASC');
|
||||
$query->orderBy('avg_response_time');
|
||||
$query->orderBy(Db::raw("convert(substr(user_name,1,1) using `GBK`)"), 'asc');// 名称排名
|
||||
$query->orderBy(Db::raw("convert(substr(gdxz_user_doctor.user_name,1,1) using `GBK`)"), 'asc');// 名称排名
|
||||
} elseif ($sort_order == 5) {
|
||||
// 服务数从多到少
|
||||
$query->orderBy('served_patients_num', 'desc');
|
||||
$query->orderBy(Db::raw("convert(substr(user_name,1,1) using `GBK`)"), 'asc');// 名称排名
|
||||
$query->orderBy(Db::raw("convert(substr(gdxz_user_doctor.user_name,1,1) using `GBK`)"), 'asc');// 名称排名
|
||||
}
|
||||
}
|
||||
|
||||
@@ -418,6 +328,62 @@ class UserDoctor extends Model
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取问诊医生列表
|
||||
* 专家问诊-公益问诊共用
|
||||
* @param string $keyword
|
||||
* @param array $hospital_params 医院搜索条件
|
||||
* @param array $doctor_params 医生搜索条件
|
||||
* @param array $doctor_expertise_params
|
||||
* @param int $is_search_welfare_reception 是否搜索公益问诊
|
||||
* @param string|int $is_first_online 是否优先在线(1:是)
|
||||
* @param string|int $sort_order
|
||||
* @param array $fields
|
||||
* @param int|null $page
|
||||
* @param int|null $per_page
|
||||
* @return array
|
||||
*/
|
||||
public static function getInquiryDoctorPageTest(string $keyword = "", array $hospital_params = [], array $doctor_params = [], array $doctor_expertise_params = [],int $is_search_welfare_reception = 0,string|int $is_first_online = 0, string|int $sort_order = 1, array $fields = ["*"], int $page = null, ?int $per_page = 10): array
|
||||
{
|
||||
$doctors = UserDoctor::join('user', function ($query) {
|
||||
$query->on('user_doctor.user_id', '=', 'user.user_id');
|
||||
})
|
||||
->select("user_doctor.*")
|
||||
->orderBy('user.is_online', 'desc')
|
||||
->get();
|
||||
|
||||
dump($doctors->toArray());
|
||||
return $doctors;
|
||||
|
||||
// $query = self::orderBy('served_patients_num', 'desc');
|
||||
//
|
||||
// if ($is_first_online == 1){
|
||||
// $query = $query->join('user', function ($query) {
|
||||
// $query->on('user_doctor.user_id', '=', 'user.user_id')s
|
||||
// ->orderBy('user.is_online', 'desc');
|
||||
// })
|
||||
// ->select(['user_doctor.*','user.is_online']);
|
||||
// }q
|
||||
|
||||
// if (!empty($sort_order)){
|
||||
// if ($sort_order == 1) {
|
||||
// // 综合-价格从低到高
|
||||
// $query->orderBy('served_patients_num', 'desc');// 服务数从多到少
|
||||
// }
|
||||
// }
|
||||
|
||||
// $result = $query->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;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取是否存在
|
||||
|
||||
@@ -16,7 +16,6 @@ use Hyperf\Snowflake\Concern\Snowflake;
|
||||
* @property string $union_id 微信开放平台唯一标识
|
||||
* @property string $wx_session_key 微信会话密钥
|
||||
* @property int $status 状态(0:禁用 1:正常 2:删除)
|
||||
* @property int $is_online 是否在线(0:不在线 1:在线)
|
||||
* @property string $avatar 头像
|
||||
* @property int $pharmacist_title 职称
|
||||
* @property int $department_custom_id 科室id-自定义
|
||||
@@ -39,7 +38,7 @@ class UserPharmacist extends Model
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected array $fillable = ['pharmacist_id', 'user_id', 'user_name', 'open_id', 'union_id', 'wx_session_key', 'status', 'is_online', 'avatar', 'pharmacist_title', 'department_custom_id', 'department_custom_name', 'department_custom_mobile', 'medical_institution', 'worker_date', 'created_at', 'updated_at'];
|
||||
protected array $fillable = ['pharmacist_id', 'user_id', 'user_name', 'open_id', 'union_id', 'wx_session_key', 'status', 'avatar', 'pharmacist_title', 'department_custom_id', 'department_custom_name', 'department_custom_mobile', 'medical_institution', 'worker_date', 'created_at', 'updated_at'];
|
||||
|
||||
protected string $primaryKey = "pharmacist_id";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user