修改问诊配置
This commit is contained in:
@@ -9,6 +9,7 @@ namespace App\Model;
|
||||
use Hyperf\Database\Model\Collection;
|
||||
use Hyperf\Database\Model\Relations\HasOne;
|
||||
use Hyperf\Snowflake\Concern\Snowflake;
|
||||
use Hyperf\DbConnection\Db;
|
||||
|
||||
/**
|
||||
* @property int $inquiry_time_id 主键id
|
||||
@@ -112,10 +113,30 @@ class DoctorInquiryTime extends Model
|
||||
->get($fields);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static function add(array $data): \Hyperf\Database\Model\Model|DoctorInquiryTime
|
||||
{
|
||||
return self::create($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取坐班时间包含某时间的平台深度合作医生
|
||||
* @param array $params
|
||||
* @param array $user_doctor_params
|
||||
* @param array $user_doctor_not_in_params
|
||||
* @param array $doctor_inquiry_config_params
|
||||
* @param array $fields
|
||||
* @return array|\Hyperf\Collection\Collection|Collection
|
||||
*/
|
||||
public static function getMinPlatDeepCooperationDoctor(array $params = [],array $user_doctor_params = [], array $user_doctor_not_in_params = [],array $doctor_inquiry_config_params = [], array $fields = ['*']): Collection|array|\Hyperf\Collection\Collection
|
||||
{
|
||||
$doctor_ids = Db::table('doctor_inquiry_config')->where($doctor_inquiry_config_params)->select("doctor_id");
|
||||
|
||||
$result = self::whereHas('UserDoctor' , function($query) use ($user_doctor_params,$user_doctor_not_in_params){
|
||||
$query->where($user_doctor_params)->whereNotIn('doctor_id',$user_doctor_not_in_params);
|
||||
})
|
||||
->where($params)
|
||||
->whereIn("doctor_id",$doctor_ids)
|
||||
->get($fields);
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -397,4 +397,22 @@ class UserDoctor extends Model
|
||||
->where($params)
|
||||
->get($fields);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取医生数据-医生配置
|
||||
* @param array $params
|
||||
* @param array $not_in_params
|
||||
* @param array $doctor_inquiry_config_params
|
||||
* @param array $fields
|
||||
* @return Collection|array|\Hyperf\Utils\Collection
|
||||
*/
|
||||
public static function getListWithConfig(array $params = [], array $not_in_params = [],array $doctor_inquiry_config_params = [],array $fields = ['*']): Collection|array|\Hyperf\Utils\Collection
|
||||
{
|
||||
$doctor_ids = Db::table('doctor_inquiry_config')->where($doctor_inquiry_config_params)->select("doctor_id");
|
||||
|
||||
return self::where($params)
|
||||
->whereNotIn('doctor_id',$not_in_params)
|
||||
->whereIn("doctor_id",$doctor_ids)
|
||||
->get($fields);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user