wupengfei 2 年之前
父節點
當前提交
2384f9f84a
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      application/common/model/GoodsOrder.php

+ 4 - 1
application/common/model/GoodsOrder.php

@@ -7,7 +7,10 @@ class GoodsOrder extends Model
     protected $name='store_order';
     public function orderItem()
     {
-        return $this->hasMany('GoodsOrderItem','order_id');
+        return $this->hasMany('GoodsOrderItem','order_id')
+            ->alias('i')
+            ->field('i.*,g.cover goods_cover')
+            ->leftJoin('StoreGoods g','i.goods_id = g.id');
     }
 
     public function orderBill()