Merge branch 'dev'
This commit is contained in:
commit
d7dd93ac6a
120
app/Command/AdjustDoctorInquiryPriceCommand.php
Normal file
120
app/Command/AdjustDoctorInquiryPriceCommand.php
Normal file
@ -0,0 +1,120 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Command;
|
||||
|
||||
use App\Constants\HttpEnumCode;
|
||||
use App\Model\DoctorInquiryConfig;
|
||||
use App\Model\DoctorInquiryPriceRecord;
|
||||
use App\Model\UserDoctor;
|
||||
use Hyperf\Command\Command as HyperfCommand;
|
||||
use Hyperf\Command\Annotation\Command;
|
||||
use Hyperf\DbConnection\Db;
|
||||
use Hyperf\Redis\Redis;
|
||||
use Psr\Container\ContainerExceptionInterface;
|
||||
use Psr\Container\ContainerInterface;
|
||||
use Psr\Container\NotFoundExceptionInterface;
|
||||
|
||||
#[Command]
|
||||
class AdjustDoctorInquiryPriceCommand extends HyperfCommand
|
||||
{
|
||||
public function __construct(protected ContainerInterface $container)
|
||||
{
|
||||
parent::__construct('AdjustDoctorInquiryPriceCommand');
|
||||
}
|
||||
|
||||
public function configure()
|
||||
{
|
||||
parent::configure();
|
||||
$this->setDescription('调整医生问诊价格/每日接诊数量-公益问诊');
|
||||
}
|
||||
|
||||
public function handle(): void
|
||||
{
|
||||
$this->line("开始");
|
||||
|
||||
// 获取需执行的医生列表
|
||||
$params = array();
|
||||
$params[] = ['inquiry_mode', '=', 1];// 接诊方式(1:图文 2:视频 3:语音 4:电话 5:会员)
|
||||
$doctor_inquiry_configs = DoctorInquiryConfig::getInquiryConfigListByInquiryType($params,['*'],[3]);
|
||||
if (empty($doctor_inquiry_configs)){
|
||||
$this->line("无数据可执行");
|
||||
}
|
||||
|
||||
try {
|
||||
$redis = $this->container->get(Redis::class);
|
||||
} catch (\Throwable $e) {
|
||||
$this->line($e->getMessage());
|
||||
return;
|
||||
}
|
||||
|
||||
foreach ($doctor_inquiry_configs as $doctor_inquiry_config){
|
||||
$redis_key = "DoctorInquiryConfig" . $doctor_inquiry_config['doctor_id'];
|
||||
$redis_value = $redis->get($redis_key);
|
||||
if (!empty($redis_value)){
|
||||
// 此医生已处理过,跳过
|
||||
continue;
|
||||
}
|
||||
|
||||
// 价格不为0不处理
|
||||
if ($doctor_inquiry_config['inquiry_price'] != 0){
|
||||
continue;
|
||||
}
|
||||
|
||||
Db::beginTransaction();
|
||||
try {
|
||||
// 获取医生数据
|
||||
$params = array();
|
||||
$params['doctor_id'] = $doctor_inquiry_config['doctor_id'];
|
||||
$user_doctor = UserDoctor::getOne($params);
|
||||
if (empty($user_doctor)){
|
||||
Db::rollBack();
|
||||
$this->line("存在一个错误医生:" . $doctor_inquiry_config['doctor_id']);
|
||||
continue;
|
||||
}
|
||||
|
||||
// 公益合作医生不处理
|
||||
if ($user_doctor['is_welfare_cooperation'] == 1){
|
||||
Db::rollBack();
|
||||
continue;
|
||||
}
|
||||
|
||||
// 调整该医生价格
|
||||
$params = array();
|
||||
$params['inquiry_config_id'] = $doctor_inquiry_config['inquiry_config_id'];
|
||||
DoctorInquiryConfig::inc($params,"inquiry_price",5);
|
||||
|
||||
// 调整该医生每日接诊数量
|
||||
$params = array();
|
||||
$params['inquiry_config_id'] = $doctor_inquiry_config['inquiry_config_id'];
|
||||
|
||||
$data = array();
|
||||
$data['work_num_day'] = 3;
|
||||
DoctorInquiryConfig::editInquiryConfig($params,$data);
|
||||
|
||||
// 记录修改记录
|
||||
$data = array();
|
||||
$data['doctor_id'] = $doctor_inquiry_config['doctor_id'];
|
||||
$data['inquiry_config_id'] = $doctor_inquiry_config['inquiry_config_id'];
|
||||
$data['old_price'] = $doctor_inquiry_config['inquiry_price'];
|
||||
$data['new_price'] = $doctor_inquiry_config['inquiry_price'] + 5;
|
||||
$doctor_inquiry_price_record = DoctorInquiryPriceRecord::addRecord($data);
|
||||
if (empty($doctor_inquiry_price_record)) {
|
||||
Db::rollBack();
|
||||
$this->line("添加记录失败");
|
||||
}
|
||||
|
||||
// 添加缓存记录该医生已处理
|
||||
$redis->set($redis_key, 1, 60 * 60 * 24 * 1);
|
||||
|
||||
Db::commit();
|
||||
}catch (\Throwable $e){
|
||||
Db::rollBack();
|
||||
$this->line($e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
$this->line("全部结束");
|
||||
}
|
||||
}
|
||||
@ -106,7 +106,8 @@ class TestController extends AbstractController
|
||||
}
|
||||
|
||||
// 获取未接诊的医生
|
||||
public function uninquiry(){
|
||||
public function uninquiry(): \Psr\Http\Message\ResponseInterface
|
||||
{
|
||||
$datas = array();
|
||||
|
||||
$params = array();
|
||||
|
||||
@ -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
|
||||
|
||||
@ -441,10 +441,10 @@ class CaService extends BaseService
|
||||
|
||||
/**
|
||||
* 进行处方pdf签章
|
||||
* @param string $type 类型 1:医院 2:医生 3:药师
|
||||
* @param string|int $type 类型 1:医院 2:医生 3:药师
|
||||
* @return string 文件id
|
||||
*/
|
||||
public function addSignPdf(string $type): string
|
||||
public function addSignPdf(string|int $type): string
|
||||
{
|
||||
$oss = new Oss();
|
||||
|
||||
@ -525,7 +525,6 @@ class CaService extends BaseService
|
||||
throw new BusinessException("处方pdf打开失败");
|
||||
}
|
||||
|
||||
|
||||
// 处方pdf进行签章
|
||||
$data = array();
|
||||
$data['sign_param'] = json_encode($sign_param);
|
||||
|
||||
@ -9,7 +9,6 @@ use App\Model\DoctorConfigFollowPackage;
|
||||
use App\Model\DoctorConfigFollowPackageItem;
|
||||
use App\Model\DoctorConfigHealthPackage;
|
||||
use App\Model\DoctorInquiryConfig;
|
||||
use App\Model\DoctorInquiryConfigService;
|
||||
use App\Model\DoctorInquiryPriceRecord;
|
||||
use App\Model\HealthPackage;
|
||||
use App\Model\SystemInquiryConfig;
|
||||
@ -521,6 +520,12 @@ class DoctorInquiryService extends BaseService
|
||||
|
||||
// 验证-问诊价格
|
||||
// 义诊时不判断,义诊为选择价格,价格后台可调节
|
||||
if ($inquiry_type == 3 && $inquiry_price == 0) {
|
||||
if ($doctor['is_welfare_cooperation'] != 1){
|
||||
return fail(HttpEnumCode::HTTP_ERROR, "请联系客服开通权限~");
|
||||
}
|
||||
}
|
||||
|
||||
if ($inquiry_type != 3) {
|
||||
if (!empty($system_inquiry_config['min_inquiry_price']) && !empty($system_inquiry_config['max_inquiry_price'])) {
|
||||
if ($inquiry_price > $system_inquiry_config['max_inquiry_price'] || $inquiry_price < $system_inquiry_config['min_inquiry_price']) {
|
||||
|
||||
@ -154,6 +154,7 @@ class IndexService extends BaseService
|
||||
"avg_response_time",
|
||||
"number_of_fans",
|
||||
"avatar",
|
||||
"is_welfare_cooperation",
|
||||
];
|
||||
|
||||
$doctor = UserDoctorModel::getOne($params, $fields);
|
||||
@ -226,6 +227,7 @@ class IndexService extends BaseService
|
||||
$info['accepting_inquiry_num'] = $accepting_inquiry_num ?? 0;// 获取接诊中患者个数
|
||||
$info['reject_prescription_number'] = $reject_prescription_number ?? 0;// 获取被驳回处方数据
|
||||
$info['introduction_status'] = $doctor['introduction_status'];// 个人简介审核状态(0:未审核 1:审核通过 2:审核中 3:审核失败)
|
||||
$info['is_welfare_cooperation'] = $doctor['is_welfare_cooperation'];// 是否公益问诊合作医生(可把公益问诊设为0元)
|
||||
|
||||
$data = array();
|
||||
$data['banner'] = $banner ?? [];// banner
|
||||
|
||||
@ -14,7 +14,6 @@ use App\Model\DetectionProject;
|
||||
use App\Model\DiseaseClass;
|
||||
use App\Model\DoctorConfigDifficultConsultation;
|
||||
use App\Model\DoctorInquiryConfig;
|
||||
use App\Model\DoctorInquiryConfigService;
|
||||
use App\Model\Hospital;
|
||||
use App\Model\InquiryCaseProduct;
|
||||
use App\Model\MessageIm;
|
||||
@ -2282,4 +2281,42 @@ class InquiryService extends BaseService
|
||||
return $result->toArray();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取医生当日有效问诊数量
|
||||
* @param string|int $doctor_id
|
||||
* @param string|int $inquiry_type
|
||||
* @return int|mixed
|
||||
*/
|
||||
public function getDoctorDayInquiryCount(string|int $doctor_id,string|int $inquiry_type): mixed
|
||||
{
|
||||
$params = array();
|
||||
$params[] = ['doctor_id', '=', $doctor_id];
|
||||
$params[] = ['inquiry_type', '=', $inquiry_type];
|
||||
$params[] = ['inquiry_mode', '=', 1];
|
||||
$params[] = ['inquiry_refund_status', '=', 0];
|
||||
|
||||
// 获取当天开始时间
|
||||
$start_date = date('Y-m-d 00:00:00', time());
|
||||
// 获取当天结束时间
|
||||
$end_date = date('Y-m-d 23:59:59', time());
|
||||
$created_at = [$start_date, $end_date];
|
||||
|
||||
$inquiry_status_params = [1,2,3,4,5,6,7];
|
||||
|
||||
$order_inquirys = OrderInquiry::getInquiryWithCreateTime($params,$created_at,$inquiry_status_params);
|
||||
if (empty($order_inquirys)){
|
||||
return 0;
|
||||
}
|
||||
|
||||
$count = 0;
|
||||
foreach ($order_inquirys as $order_inquiry){
|
||||
if ($order_inquiry['inquiry_status'] == 7){
|
||||
continue;
|
||||
}
|
||||
|
||||
$count = $count + 1;
|
||||
}
|
||||
|
||||
return $count;
|
||||
}
|
||||
}
|
||||
@ -22,7 +22,6 @@ use App\Model\DoctorConfigHealthPackage;
|
||||
use App\Model\DoctorExpertise;
|
||||
use App\Model\DoctorInquiryConfig;
|
||||
use App\Model\DoctorInquiryConfig as DoctorInquiryConfigModel;
|
||||
use App\Model\DoctorInquiryConfigService;
|
||||
use App\Model\DoctorInquiryTime;
|
||||
use App\Model\DoctorWord;
|
||||
use App\Model\Hospital;
|
||||
@ -2184,6 +2183,8 @@ class UserDoctorService extends BaseService
|
||||
// 获取医生问诊配置-问诊购药
|
||||
$result['multi_point_enable'] = 0;
|
||||
|
||||
$inquiryService = new InquiryService();
|
||||
|
||||
// 获取问诊价格
|
||||
// 专家-公益
|
||||
$params = array();
|
||||
@ -2192,22 +2193,8 @@ class UserDoctorService extends BaseService
|
||||
$doctor_inquiry_config = DoctorInquiryConfigModel::getInquiryConfigListByInquiryType($params,['*'],[1,3,4]);
|
||||
if (!empty($doctor_inquiry_config)) {
|
||||
foreach ($doctor_inquiry_config as &$value) {
|
||||
// 获取医生当日的全部订单
|
||||
$params = array();
|
||||
$params[] = ['doctor_id', '=', $doctor_id];
|
||||
$params[] = ['inquiry_type', '=', $value['inquiry_type']];
|
||||
$params[] = ['inquiry_mode', '=', 1];
|
||||
$params[] = ['inquiry_refund_status', '=', 0];
|
||||
|
||||
// 获取当天开始时间
|
||||
$start_date = date('Y-m-d 00:00:00', time());
|
||||
|
||||
// 获取当天结束时间
|
||||
$end_date = date('Y-m-d 23:59:59', time());
|
||||
|
||||
$created_at = [$start_date, $end_date];
|
||||
|
||||
$value['order_inquiry_count'] = OrderInquiry::getDateCount($params,$created_at);
|
||||
// 获取医生当日有效问诊数量
|
||||
$value['order_inquiry_count'] = $inquiryService->getDoctorDayInquiryCount($doctor_id, $value['inquiry_type']);
|
||||
|
||||
// 获取系统问诊配置
|
||||
$fields = [
|
||||
@ -2435,28 +2422,16 @@ class UserDoctorService extends BaseService
|
||||
return fail(HttpEnumCode::HTTP_SUCCESS, "医生错误");
|
||||
}
|
||||
|
||||
$inquiryService = new InquiryService();
|
||||
|
||||
// 获取问诊配置
|
||||
$params = array();
|
||||
$params[] = ['doctor_id', '=', $doctor_id];
|
||||
$doctor_inquiry_config = DoctorInquiryConfigModel::getInquiryConfigListByInquiryType($params,['*'],[1,3,4]);
|
||||
if (!empty($doctor_inquiry_config)) {
|
||||
foreach ($doctor_inquiry_config as &$value) {
|
||||
// 获取医生当日的全部订单
|
||||
$params = array();
|
||||
$params[] = ['doctor_id', '=', $doctor_id];
|
||||
$params[] = ['inquiry_type', '=', $value['inquiry_type']];
|
||||
$params[] = ['inquiry_mode', '=', 1];
|
||||
$params[] = ['inquiry_refund_status', '=', 0];
|
||||
|
||||
// 获取当天开始时间
|
||||
$start_date = date('Y-m-d 00:00:00', time());
|
||||
|
||||
// 获取当天结束时间
|
||||
$end_date = date('Y-m-d 23:59:59', time());
|
||||
|
||||
$created_at = [$start_date, $end_date];
|
||||
|
||||
$value['order_inquiry_count'] = OrderInquiry::getDateCount($params,$created_at);
|
||||
// 获取医生当日有效问诊数量
|
||||
$value['order_inquiry_count'] = $inquiryService->getDoctorDayInquiryCount($doctor_id, $value['inquiry_type']);
|
||||
|
||||
// 获取回合数以及问诊时间
|
||||
if ($value['inquiry_mode'] == 6){
|
||||
|
||||
@ -894,10 +894,11 @@ Router::addGroup('/case', function () {
|
||||
Router::addGroup('/test', function () {
|
||||
Router::get('', [TestController::class, 'test']);
|
||||
|
||||
//
|
||||
// Router::get('/uninquiry', [TestController::class, 'uninquiry']);
|
||||
// 获取未接诊的医生
|
||||
Router::get('/uninquiry', [TestController::class, 'uninquiry']);
|
||||
|
||||
// 模拟退款
|
||||
// Router::post('/refund', [TestController::class, 'refund']);
|
||||
Router::post('/refund', [TestController::class, 'refund']);
|
||||
|
||||
});
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user