diff --git a/plugs/think-plugs-ticket/src/controller/UserShare.php b/plugs/think-plugs-ticket/src/controller/UserShare.php index fe197e1..197fbcf 100644 --- a/plugs/think-plugs-ticket/src/controller/UserShare.php +++ b/plugs/think-plugs-ticket/src/controller/UserShare.php @@ -47,7 +47,7 @@ class UserShare extends Controller $where = $this->_vali([ 'id.require' => '随手拍ID不能为空', ]); - $this->vo = TicketUserShare::mk()->where($where)->findOrEmpty(); + $this->vo = TicketUserShare::mk()->where($where)->with(['linked_ticket'])->findOrEmpty(); if ($this->vo->isEmpty()) $this->error('用户随手拍不存在!'); $this->fetch('detail'); } diff --git a/plugs/think-plugs-ticket/src/model/TicketUserShare.php b/plugs/think-plugs-ticket/src/model/TicketUserShare.php index 7342307..cd1181f 100644 --- a/plugs/think-plugs-ticket/src/model/TicketUserShare.php +++ b/plugs/think-plugs-ticket/src/model/TicketUserShare.php @@ -25,4 +25,9 @@ class TicketUserShare extends Model return '未知'; } } + + public function linkedTicket() + { + return $this->belongsTo(TicketTicket::class, 'linked_ticket_id', 'id'); + } } \ No newline at end of file diff --git a/plugs/think-plugs-ticket/src/view/user_share/detail.html b/plugs/think-plugs-ticket/src/view/user_share/detail.html index 7142d30..58ff4dc 100644 --- a/plugs/think-plugs-ticket/src/view/user_share/detail.html +++ b/plugs/think-plugs-ticket/src/view/user_share/detail.html @@ -1,75 +1,103 @@ -
随手拍编号 | +{$vo.id|default=""} | +
随手拍类型 | +{$vo.type_name|default=""} | +
联系方式 | +{$vo.contact_phone|default="未填写联系方式"} | +
随手拍地址 | +{$vo.ticket_address|default=""} | +
随手拍内容 | +{$vo.content|default=""} | +
随手拍图片 | +
+
+ {foreach $vo.imgs_arr as $img}
+
+ |
+