浏览代码

一些功能

Kirin 4 年之前
父节点
当前提交
067cbd3178
共有 1 个文件被更改,包括 11 次插入1 次删除
  1. 11 1
      app/models/store/StoreOrder.php

+ 11 - 1
app/models/store/StoreOrder.php

@@ -830,6 +830,16 @@ class StoreOrder extends BaseModel
 //        ]);
     }
 
+    public static function point()
+    {
+        return self::hasOne(SystemStorePoint::class, 'id', 'point_id')->field('*');
+    }
+
+    public static function store()
+    {
+        return self::hasOne(SystemStore::class, 'id', 'store_id')->field('*');
+    }
+
     /**
      * 获取订单详情
      * @param $uid
@@ -841,7 +851,7 @@ class StoreOrder extends BaseModel
      */
     public static function getUserOrderDetail($uid, $key)
     {
-        return self::where('order_id|unique', $key)->where('uid', $uid)->where('is_del', 0)->find();
+        return self::with(['store', 'point'])->where('order_id|unique', $key)->where('uid', $uid)->where('is_del', 0)->find();
     }