作者 何书鹏
1 个管道 的构建 通过 耗费 3 秒

预约时间

... ... @@ -136,7 +136,8 @@ class Index extends Api
* @ApiSummary (专科服务-预约)
* @ApiMethod (POST)
* @ApiParams (name=type, type=integer, required=true, description="服务类型:1=文字沟通,2=音频沟通")
* @ApiParams (name=date, type=string, required=true, description="日期")
* @ApiParams (name=date, type=string, required=true, description="日期", sample="2021-07-08")
* @ApiParams (name=time, type=string, required=true, description="时间", sample="11:00")
* @ApiParams (name=description, type=string, required=true, description="病状描述")
* @ApiParams (name=dept_id, type=integer, required=true, description="专科ID")
* @ApiParams (name=doctor_id, type=integer, required=true, description="专科ID")
... ... @@ -150,7 +151,8 @@ class Index extends Api
public function appointment(){
$post = $this->request->post();
empty($post['type']) && $this->error('请选择服务类型');
empty($post['date']) && $this->error('请选择预约时间');
empty($post['date']) && $this->error('请选择预约日期');
empty($post['time']) && $this->error('请选择预约时间');
empty($post['description']) && $this->error('请填写病状描述');
!in_array($post['type'],[1,2]) && $this->error('服务类型不合法');
for($i = 0; $i < 7; $i++){
... ... @@ -225,7 +227,7 @@ class Index extends Api
'pay_fee' => $pay_fee,
'dept_ids' => $dept_ids,
'is_distribute' => $is_distribute,
'date_time' => strtotime($post['date']),
'date_time' => strtotime($post['date']. ' ' .$post['time']),
'type' => $post['type'],
'description' => $post['description'],
'date' => $post['date']
... ...
... ... @@ -121,7 +121,7 @@ class Notify extends Api
// 给被预约医生发送短信提醒
if(Validate::regex($doctor['mobile'], "^1\d{10}$")){
$ret = send_sms2([
'content' => '【在线会诊】预约人名称:' . $appointment['user']['nickname'] . ',下单时间:' . date('Y-m-d H:i:s') . ',预约时间:' . $appointment['date'] . ',价格:' .$appointment['pay_fee']. '元',//短信内容
'content' => '【在线会诊】预约人名称:' . $appointment['user']['nickname'] . ',下单时间:' . date('Y-m-d H:i:s') . ',预约时间:' . date('Y-m-d H:i',$appointment['date_time']) . ',价格:' .$appointment['pay_fee']. '元',//短信内容
'mobile' => $doctor['mobile'],//手机号码
'tKey' => time(),
]);
... ... @@ -133,7 +133,7 @@ class Notify extends Api
// 给预约用户发送短信提醒
if(Validate::regex($appointment['user']['mobile'], "^1\d{10}$")){
$ret = send_sms2([
'content' => '【在线会诊】被预约医生名称:' . $doctor['nickname'] . ',下单时间:' . date('Y-m-d H:i:s') . ',预约时间:' . $appointment['date'] . ',价格:' .$appointment['pay_fee']. '元',//短信内容
'content' => '【在线会诊】被预约医生名称:' . $doctor['nickname'] . ',下单时间:' . date('Y-m-d H:i:s') . ',预约时间:' . date('Y-m-d H:i',$appointment['date_time']) . ',价格:' .$appointment['pay_fee']. '元',//短信内容
'mobile' => $appointment['user']['mobile'],//手机号码
'tKey' => time(),
]);
... ...
... ... @@ -50,4 +50,9 @@ class Appointment extends Model
public function appraise(){
return $this->hasOne('AppointmentAppraise');
}
// 预约日期
public function getDateAttr($value,$data){
return date('Y-m-d H:i',$data['date_time']);
}
}
... ...
... ... @@ -3877,6 +3877,12 @@
<td>日期</td>
</tr>
<tr>
<td>time</td>
<td>string</td>
<td></td>
<td>时间</td>
</tr>
<tr>
<td>description</td>
<td>string</td>
<td></td>
... ... @@ -3922,7 +3928,11 @@
</div>
<div class="form-group">
<label class="control-label" for="date">date</label>
<input type="string" class="form-control input-sm" id="date" required placeholder="日期" name="date">
<input type="string" class="form-control input-sm" id="date" required placeholder="日期 - 例: 2021-07-08" name="date">
</div>
<div class="form-group">
<label class="control-label" for="time">time</label>
<input type="string" class="form-control input-sm" id="time" required placeholder="时间 - 例: 11:00" name="time">
</div>
<div class="form-group">
<label class="control-label" for="description">description</label>
... ... @@ -8658,7 +8668,7 @@
</div>
<div class="col-md-6" align="right">
Generated on 2021-07-28 12:02:56 <a href="./" target="_blank">我的网站</a>
Generated on 2021-07-29 14:47:20 <a href="./" target="_blank">我的网站</a>
</div>
</div>
... ...