fix user trans fatal bug

This commit is contained in:
LI JIAHAO
2017-06-14 14:33:56 +08:00
parent f2be5eca47
commit eb3451a26a
2 changed files with 6 additions and 3 deletions
+1 -1
View File
@@ -270,7 +270,7 @@ class UserController extends Controller
{
$data = [];
$user_id = $request->session()->get('user_id');
$data['trans'] = Transaction::with('feedback')->where('buyer_id', $user_id)->orderBy('id', 'desc')->paginate(15);
$data['trans'] = Transaction::with('feedback', 'good')->where('buyer_id', $user_id)->orderBy('id', 'desc')->paginate(15);
return view::make('user.buyer')->with($data);
}
+5 -2
View File
@@ -33,8 +33,11 @@
<tr id="tran{{ $tran->id }}">
<td>{{ $tran->id }}</td>
<td><a href="/good/{{$tran->good_id}}"
onMouseOver="toolTip('<img src=/good/{{ sha1($tran->good_id) }}/titlepic>')"
onMouseOut="toolTip()">{{ $tran->good->good_name }}</a></td>
@if(isset($tran->good))
onMouseOver="toolTip('<img src=/good/{{ sha1($tran->good_id) }}/titlepic>')"
onMouseOut="toolTip()"
@endif
>{{ isset($tran->good) ? $tran->good->good_name : "此商品已删除" }}</a></td>
<td>{{ $tran->number }}</td>
@if($tran->status == 0)
<td>