|
@@ -19,7 +19,7 @@ class Appointment extends Permissions
|
|
|
{
|
|
|
$pid = $this->request->param('pid', 0, 'intval');
|
|
|
|
|
|
- $post = $this->request->post();
|
|
|
+ $post = $this->request->post();
|
|
|
$post['provider_id'] = $pid;
|
|
|
|
|
|
if ($this->request->isPost()) {
|
|
@@ -33,19 +33,19 @@ class Appointment extends Permissions
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- $model = $this->getModel();
|
|
|
+ $model = $this->getModel();
|
|
|
$appointment = $model->where('provider_id', $pid)->find();
|
|
|
|
|
|
if ($appointment) {
|
|
|
//修改
|
|
|
if ($this->request->isPost()) {
|
|
|
|
|
|
- $weeks = $post['weeks']??[];
|
|
|
- $weeks = array_keys($weeks);
|
|
|
+ $weeks = $post['weeks'] ?? [];
|
|
|
+ $weeks = array_keys($weeks);
|
|
|
$post['weeks'] = implode(',', $weeks);
|
|
|
|
|
|
- $post['morning_time_periods'] = json_encode($post['morning_time_periods']??[]);
|
|
|
- $post['afternoon_time_periods'] = json_encode($post['afternoon_time_periods']??[]);
|
|
|
+ $post['morning_time_periods'] = json_encode($post['morning_time_periods'] ?? []);
|
|
|
+ $post['afternoon_time_periods'] = json_encode($post['afternoon_time_periods'] ?? []);
|
|
|
|
|
|
if (false == $appointment->allowField(true)->save($post)) {
|
|
|
$this->error('修改失败');
|
|
@@ -63,12 +63,12 @@ class Appointment extends Permissions
|
|
|
//新增
|
|
|
if ($this->request->isPost()) {
|
|
|
|
|
|
- $weeks = $post['weeks']??[];
|
|
|
- $weeks = array_keys($weeks);
|
|
|
+ $weeks = $post['weeks'] ?? [];
|
|
|
+ $weeks = array_keys($weeks);
|
|
|
$post['weeks'] = implode(',', $weeks);
|
|
|
|
|
|
- $post['morning_time_periods'] = json_encode($post['morning_time_periods']??[]);
|
|
|
- $post['afternoon_time_periods'] = json_encode($post['afternoon_time_periods']??[]);
|
|
|
+ $post['morning_time_periods'] = json_encode($post['morning_time_periods'] ?? []);
|
|
|
+ $post['afternoon_time_periods'] = json_encode($post['afternoon_time_periods'] ?? []);
|
|
|
|
|
|
if (false == $model->allowField(true)->save($post)) {
|
|
|
$this->error('添加失败');
|
|
@@ -100,8 +100,9 @@ class Appointment extends Permissions
|
|
|
$where['provider_id'] = ['in', $id];
|
|
|
}
|
|
|
|
|
|
+ $where['appointment_daytime'] = ['>', time()];
|
|
|
//删除该专家所有号源和记录
|
|
|
-// (new \app\common\model\AppointmentTicket())->where($where)->delete();
|
|
|
+ (new \app\common\model\AppointmentTicket())->where($where)->delete();
|
|
|
// (new \app\common\model\AppointmentApplication())->where($where)->delete();
|
|
|
}
|
|
|
|