Merge branch 'dev'
This commit is contained in:
@@ -6,6 +6,7 @@ namespace App\Model;
|
||||
|
||||
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Hyperf\Database\Model\Relations\HasOne;
|
||||
use Hyperf\Snowflake\Concern\Snowflake;
|
||||
|
||||
@@ -18,8 +19,8 @@ use Hyperf\Snowflake\Concern\Snowflake;
|
||||
* @property int $last_enable_method 最后开启方式(1:自己 2:后台)
|
||||
* @property int $work_num_day 每日接诊数量
|
||||
* @property string $inquiry_price 接诊价格(专家问诊-公益问诊)
|
||||
* @property \Carbon\Carbon $created_at 创建时间
|
||||
* @property \Carbon\Carbon $updated_at 修改时间
|
||||
* @property Carbon $created_at 创建时间
|
||||
* @property Carbon $updated_at 修改时间
|
||||
*/
|
||||
class DoctorInquiryConfig extends Model
|
||||
{
|
||||
@@ -35,11 +36,6 @@ class DoctorInquiryConfig extends Model
|
||||
*/
|
||||
protected array $fillable = ['inquiry_config_id', 'doctor_id', 'inquiry_type', 'inquiry_mode', 'is_enable', 'last_enable_method', 'work_num_day', 'inquiry_price', 'created_at', 'updated_at'];
|
||||
|
||||
/**
|
||||
* The attributes that should be cast to native types.
|
||||
*/
|
||||
protected array $casts = ['inquiry_config_id' => 'string', 'doctor_id' => 'string', 'inquiry_type' => 'integer', 'inquiry_mode' => 'integer', 'work_num_day' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime', 'is_enable' => 'integer', 'last_enable_method' => 'integer'];
|
||||
|
||||
protected string $primaryKey = "inquiry_config_id";
|
||||
|
||||
/**
|
||||
@@ -107,4 +103,28 @@ class DoctorInquiryConfig extends Model
|
||||
{
|
||||
return self::where($params)->min('inquiry_price');
|
||||
}
|
||||
|
||||
/**
|
||||
* 自增
|
||||
* @param array $params
|
||||
* @param string $field
|
||||
* @param float $numeral
|
||||
* @return int
|
||||
*/
|
||||
public static function inc(array $params,string $field,float $numeral = 1): int
|
||||
{
|
||||
return self::where($params)->increment($field,$numeral);
|
||||
}
|
||||
|
||||
/**
|
||||
* 自减
|
||||
* @param array $params
|
||||
* @param string $field
|
||||
* @param float $numeral
|
||||
* @return int
|
||||
*/
|
||||
public static function dec(array $params,string $field,float $numeral = 1): int
|
||||
{
|
||||
return self::where($params)->decrement($field,$numeral);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,82 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Model;
|
||||
|
||||
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Hyperf\Snowflake\Concern\Snowflake;
|
||||
|
||||
/**
|
||||
* @property int $config_service_id 主键id
|
||||
* @property int $doctor_id 医生id
|
||||
* @property int $inquiry_type 接诊类型(1:专家问诊 2:快速问诊 3:公益问诊 4:问诊购药)
|
||||
* @property int $inquiry_mode 接诊方式(1:图文 2:视频 3:语音 4:电话 5:会员 6:疑难会诊 7:附赠 8:健康包 9:随访包)
|
||||
* @property string $service_content 服务内容
|
||||
* @property string $service_process 服务流程
|
||||
* @property int $service_period 服务周期
|
||||
* @property int $service_rounds 服务回合数(0表示不限次)
|
||||
* @property Carbon $created_at 创建时间
|
||||
* @property Carbon $updated_at 修改时间
|
||||
*/
|
||||
class DoctorInquiryConfigService extends Model
|
||||
{
|
||||
use Snowflake;
|
||||
|
||||
/**
|
||||
* The table associated with the model.
|
||||
*/
|
||||
protected ?string $table = 'doctor_inquiry_config_service';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected array $fillable = ['config_service_id', 'doctor_id', 'inquiry_type', 'inquiry_mode', 'service_content', 'service_process', 'service_period', 'service_rounds', 'created_at', 'updated_at'];
|
||||
|
||||
protected string $primaryKey = "config_service_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);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
* @param array $data
|
||||
* @return DoctorInquiryConfigService|\Hyperf\Database\Model\Model
|
||||
*/
|
||||
public static function addDoctorInquiryConfigService(array $data): \Hyperf\Database\Model\Model|DoctorInquiryConfigService
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -49,16 +49,17 @@ use Hyperf\Utils\Arr;
|
||||
* @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 int $is_welfare_cooperation 是否公益问诊合作医生(可把公益问诊设为0元)
|
||||
* @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[]|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
|
||||
* @property-read User|null $User
|
||||
* @property-read \Hyperf\Database\Model\Collection|DoctorInquiryConfig[]|null $DoctorInquiryConfig
|
||||
* @property-read \Hyperf\Database\Model\Collection|DoctorExpertise[]|null $DoctorExpertise
|
||||
* @property-read \Hyperf\Database\Model\Collection|OrderInquiry[]|null $OrderInquiry
|
||||
*/
|
||||
class UserDoctor extends Model
|
||||
{
|
||||
@@ -72,7 +73,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', 'introduction_status', 'introduction_time', '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 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', 'introduction_status', 'introduction_time', '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', 'is_welfare_cooperation', 'qr_code', 'be_good_at', 'brief_introduction', 'created_at', 'updated_at'];
|
||||
|
||||
protected string $primaryKey = "doctor_id";
|
||||
|
||||
@@ -119,7 +120,6 @@ class UserDoctor extends Model
|
||||
return $this->hasMany(OrderInquiry::class, "doctor_id", "doctor_id");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取医生信息-单条
|
||||
* @param array $params
|
||||
@@ -366,63 +366,6 @@ 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 array();
|
||||
|
||||
// $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;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取是否存在
|
||||
* @param array $params
|
||||
|
||||
Reference in New Issue
Block a user