wupengfei il y a 2 ans
Parent
commit
2384f9f84a
1 fichiers modifiés avec 4 ajouts et 1 suppressions
  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()