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

预约时间

@@ -136,7 +136,8 @@ class Index extends Api @@ -136,7 +136,8 @@ class Index extends Api
136 * @ApiSummary (专科服务-预约) 136 * @ApiSummary (专科服务-预约)
137 * @ApiMethod (POST) 137 * @ApiMethod (POST)
138 * @ApiParams (name=type, type=integer, required=true, description="服务类型:1=文字沟通,2=音频沟通") 138 * @ApiParams (name=type, type=integer, required=true, description="服务类型:1=文字沟通,2=音频沟通")
139 - * @ApiParams (name=date, type=string, required=true, description="日期") 139 + * @ApiParams (name=date, type=string, required=true, description="日期", sample="2021-07-08")
  140 + * @ApiParams (name=time, type=string, required=true, description="时间", sample="11:00")
140 * @ApiParams (name=description, type=string, required=true, description="病状描述") 141 * @ApiParams (name=description, type=string, required=true, description="病状描述")
141 * @ApiParams (name=dept_id, type=integer, required=true, description="专科ID") 142 * @ApiParams (name=dept_id, type=integer, required=true, description="专科ID")
142 * @ApiParams (name=doctor_id, type=integer, required=true, description="专科ID") 143 * @ApiParams (name=doctor_id, type=integer, required=true, description="专科ID")
@@ -150,7 +151,8 @@ class Index extends Api @@ -150,7 +151,8 @@ class Index extends Api
150 public function appointment(){ 151 public function appointment(){
151 $post = $this->request->post(); 152 $post = $this->request->post();
152 empty($post['type']) && $this->error('请选择服务类型'); 153 empty($post['type']) && $this->error('请选择服务类型');
153 - empty($post['date']) && $this->error('请选择预约时间'); 154 + empty($post['date']) && $this->error('请选择预约日期');
  155 + empty($post['time']) && $this->error('请选择预约时间');
154 empty($post['description']) && $this->error('请填写病状描述'); 156 empty($post['description']) && $this->error('请填写病状描述');
155 !in_array($post['type'],[1,2]) && $this->error('服务类型不合法'); 157 !in_array($post['type'],[1,2]) && $this->error('服务类型不合法');
156 for($i = 0; $i < 7; $i++){ 158 for($i = 0; $i < 7; $i++){
@@ -225,7 +227,7 @@ class Index extends Api @@ -225,7 +227,7 @@ class Index extends Api
225 'pay_fee' => $pay_fee, 227 'pay_fee' => $pay_fee,
226 'dept_ids' => $dept_ids, 228 'dept_ids' => $dept_ids,
227 'is_distribute' => $is_distribute, 229 'is_distribute' => $is_distribute,
228 - 'date_time' => strtotime($post['date']), 230 + 'date_time' => strtotime($post['date']. ' ' .$post['time']),
229 'type' => $post['type'], 231 'type' => $post['type'],
230 'description' => $post['description'], 232 'description' => $post['description'],
231 'date' => $post['date'] 233 'date' => $post['date']
@@ -121,7 +121,7 @@ class Notify extends Api @@ -121,7 +121,7 @@ class Notify extends Api
121 // 给被预约医生发送短信提醒 121 // 给被预约医生发送短信提醒
122 if(Validate::regex($doctor['mobile'], "^1\d{10}$")){ 122 if(Validate::regex($doctor['mobile'], "^1\d{10}$")){
123 $ret = send_sms2([ 123 $ret = send_sms2([
124 - 'content' => '【在线会诊】预约人名称:' . $appointment['user']['nickname'] . ',下单时间:' . date('Y-m-d H:i:s') . ',预约时间:' . $appointment['date'] . ',价格:' .$appointment['pay_fee']. '元',//短信内容 124 + 'content' => '【在线会诊】预约人名称:' . $appointment['user']['nickname'] . ',下单时间:' . date('Y-m-d H:i:s') . ',预约时间:' . date('Y-m-d H:i',$appointment['date_time']) . ',价格:' .$appointment['pay_fee']. '元',//短信内容
125 'mobile' => $doctor['mobile'],//手机号码 125 'mobile' => $doctor['mobile'],//手机号码
126 'tKey' => time(), 126 'tKey' => time(),
127 ]); 127 ]);
@@ -133,7 +133,7 @@ class Notify extends Api @@ -133,7 +133,7 @@ class Notify extends Api
133 // 给预约用户发送短信提醒 133 // 给预约用户发送短信提醒
134 if(Validate::regex($appointment['user']['mobile'], "^1\d{10}$")){ 134 if(Validate::regex($appointment['user']['mobile'], "^1\d{10}$")){
135 $ret = send_sms2([ 135 $ret = send_sms2([
136 - 'content' => '【在线会诊】被预约医生名称:' . $doctor['nickname'] . ',下单时间:' . date('Y-m-d H:i:s') . ',预约时间:' . $appointment['date'] . ',价格:' .$appointment['pay_fee']. '元',//短信内容 136 + 'content' => '【在线会诊】被预约医生名称:' . $doctor['nickname'] . ',下单时间:' . date('Y-m-d H:i:s') . ',预约时间:' . date('Y-m-d H:i',$appointment['date_time']) . ',价格:' .$appointment['pay_fee']. '元',//短信内容
137 'mobile' => $appointment['user']['mobile'],//手机号码 137 'mobile' => $appointment['user']['mobile'],//手机号码
138 'tKey' => time(), 138 'tKey' => time(),
139 ]); 139 ]);
@@ -50,4 +50,9 @@ class Appointment extends Model @@ -50,4 +50,9 @@ class Appointment extends Model
50 public function appraise(){ 50 public function appraise(){
51 return $this->hasOne('AppointmentAppraise'); 51 return $this->hasOne('AppointmentAppraise');
52 } 52 }
  53 +
  54 + // 预约日期
  55 + public function getDateAttr($value,$data){
  56 + return date('Y-m-d H:i',$data['date_time']);
  57 + }
53 } 58 }
@@ -3877,6 +3877,12 @@ @@ -3877,6 +3877,12 @@
3877 <td>日期</td> 3877 <td>日期</td>
3878 </tr> 3878 </tr>
3879 <tr> 3879 <tr>
  3880 + <td>time</td>
  3881 + <td>string</td>
  3882 + <td></td>
  3883 + <td>时间</td>
  3884 + </tr>
  3885 + <tr>
3880 <td>description</td> 3886 <td>description</td>
3881 <td>string</td> 3887 <td>string</td>
3882 <td></td> 3888 <td></td>
@@ -3922,7 +3928,11 @@ @@ -3922,7 +3928,11 @@
3922 </div> 3928 </div>
3923 <div class="form-group"> 3929 <div class="form-group">
3924 <label class="control-label" for="date">date</label> 3930 <label class="control-label" for="date">date</label>
3925 - <input type="string" class="form-control input-sm" id="date" required placeholder="日期" name="date"> 3931 + <input type="string" class="form-control input-sm" id="date" required placeholder="日期 - 例: 2021-07-08" name="date">
  3932 + </div>
  3933 + <div class="form-group">
  3934 + <label class="control-label" for="time">time</label>
  3935 + <input type="string" class="form-control input-sm" id="time" required placeholder="时间 - 例: 11:00" name="time">
3926 </div> 3936 </div>
3927 <div class="form-group"> 3937 <div class="form-group">
3928 <label class="control-label" for="description">description</label> 3938 <label class="control-label" for="description">description</label>
@@ -8658,7 +8668,7 @@ @@ -8658,7 +8668,7 @@
8658 8668
8659 </div> 8669 </div>
8660 <div class="col-md-6" align="right"> 8670 <div class="col-md-6" align="right">
8661 - Generated on 2021-07-28 12:02:56 <a href="./" target="_blank">我的网站</a> 8671 + Generated on 2021-07-29 14:47:20 <a href="./" target="_blank">我的网站</a>
8662 </div> 8672 </div>
8663 </div> 8673 </div>
8664 8674