Ver código fonte

feat(order): 添加订单状态关联查询

shichen 4 meses atrás
pai
commit
c10e39626e

+ 6 - 0
app/common/model/store/order/StoreOrder.php

@@ -93,4 +93,10 @@ class StoreOrder extends BaseModel
93 93
     {
94 94
         return $this->hasOne(PickUp::class, 'id', 'pick_up_id');
95 95
     }
96
+
97
+    public function takeStatus()
98
+    {
99
+        return $this->hasOne(StoreOrderStatus::class,'order_id','order_id')
100
+            ->where('type', '=', 'take');
101
+    }
96 102
 }

+ 1 - 1
app/common/repositories/store/order/StoreOrderRepository.php

@@ -5048,7 +5048,7 @@ class StoreOrderRepository extends BaseRepository
5048 5048
                 $query->field('uid,real_name,nickname');
5049 5049
             }, 'StoreRefundOrder' => function ($query) {
5050 5050
                 return $query->field('*');
5051
-            }, 'pickUp'
5051
+            }, 'pickUp','takeStatus'
5052 5052
         ]);
5053 5053
 
5054 5054
         $data = $data->toArray();