Răsfoiți Sursa

增加时间

linwu 1 an în urmă
părinte
comite
301d732e48

+ 2 - 1
app/api/controller/User.php

@@ -225,12 +225,13 @@ class User extends Permissions
             $where['finish_time'] = ['>', 0];
         }
         $pagenum = $this->request->param('pagenum', 20, 'intval');
-        $datalist = (new AppointmentApplication())->where($where)->order('create_time desc')->paginate($pagenum, true);
+        $datalist = AppointmentApplication::with('ticket')->where($where)->order('create_time desc')->paginate($pagenum, true);
         foreach ($datalist as $key => $item) {
             //专家信息
             $item->address;
             $item->specialist;
             $item->specialist->head_pic = geturl($item->specialist->head_pic, '', true);
+            $item->ticke_time = $item->ticket->appointment_daytime;
             $datalist[$key] = $item;
         }
         if (empty($datalist)) {

+ 5 - 0
app/common/model/AppointmentApplication.php

@@ -118,4 +118,9 @@ class AppointmentApplication extends Model
     {
         return $this->belongsTo('Specialist', 'provider_id');
     }
+
+    public function ticket()
+    {
+        return $this->hasOne(AppointmentTicket::class,'id','appointment_ticket_id');
+    }
 }