2017-06-17 69 views
0

試圖按照書Yii2,應用軟件開發,食譜 - 第三版 在第4章receipe 8: https://github.com/PacktPublishing/Yii2-Application-Development-Cookbook-Third-Edition/tree/master/Chapter04_Code/Recipe08 然而當我面臨的問題是,它僅顯示即使是一階當我以地址欄的順序輸入nr 5時,它顯示nr 1順序。 enter image description hereenter image description hereyii2形式與多個模型

clink the link for the codes

+0

你能告訴你的視圖文件? –

+0

更新你的問題,並添加你的控制器/動作和查看代碼請 – scaisEdge

+0

controller/action/view中的所有代碼都在上面提供的鏈接中:[link](https://github.com/PacktPublishing/Yii2-Application-Development -Cookbook-第三版/樹/主/ Chapter04_Code/Recipe08) – user2294301

回答

0

這一點代碼解決了這個問題:

$order = Order::find($id)->with('user','product')->where(['id' => $id])->one();