|
@@ -50,6 +50,7 @@ class Appointment extends Permissions
|
|
|
if (false == $appointment->allowField(true)->save($post)) {
|
|
|
$this->error('修改失败');
|
|
|
}
|
|
|
+ $this->publishAfter($pid);
|
|
|
$this->success('修改成功', 'index', ['pid' => $pid]);
|
|
|
} else {
|
|
|
$this->assign('data', $appointment);
|
|
@@ -84,4 +85,24 @@ class Appointment extends Permissions
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 放号设置修改,删除号源
|
|
|
+ * @param $id
|
|
|
+ * @author jiang
|
|
|
+ */
|
|
|
+ private function publishAfter($id)
|
|
|
+ {
|
|
|
+ $where = [];
|
|
|
+ if (!is_array($id)) {
|
|
|
+ $where['provider_id'] = $id;
|
|
|
+ } else {
|
|
|
+ $where['provider_id'] = ['in', $id];
|
|
|
+ }
|
|
|
+
|
|
|
+ //删除该专家所有号源和记录
|
|
|
+ (new \app\common\model\AppointmentTicket())->where($where)->delete();
|
|
|
+ (new \app\common\model\AppointmentApplication())->where($where)->delete();
|
|
|
+ }
|
|
|
+
|
|
|
}
|