Просмотр исходного кода

Merge branch 'master' of e.coding.net:zdap/weixiu/weixiu_api into data_rules-m

liugc 1 год назад
Родитель
Сommit
40f7e438fd

+ 1 - 2
app/adminapi/lists/property/PropertyOrderLists.php

@@ -94,8 +94,7 @@ class PropertyOrderLists extends BaseAdminDataLists implements ListsSearchInterf
      */
     public function lists(): array
     {
-        return PropertyOrder::with(['propertyHead','propertyUser','propertyOrderCustomerLog'])->where($this->searchWhere)->where($this->queryWhere())
-            ->field(['id', 'property_head_id', 'property_user_id', 'remark', 'order_status', 'work_id','address','create_time'])
+        return PropertyOrder::with(['propertyHead','propertyUser','propertyOrderCustomerLog','saleInfo','saleGroupInfo'])->where($this->searchWhere)->where($this->queryWhere())
             ->where($this->queryDataWhere())
             ->limit($this->limitOffset, $this->limitLength)
             ->order(['id' => 'desc'])

+ 11 - 1
app/common/model/property/PropertyOrder.php

@@ -17,6 +17,7 @@ namespace app\common\model\property;
 
 use app\common\model\BaseModel;
 use app\common\model\sale\Sale;
+use app\common\model\sale\SaleGroup;
 use app\common\model\works\ServiceWork;
 use think\facade\Log;
 
@@ -30,7 +31,16 @@ class PropertyOrder extends BaseModel
 {
     
     protected $name = 'property_order';
-
+    public function saleGroupInfo()
+    {
+        return $this->hasOne(SaleGroup::class, 'id', 'sale_group_id')
+            ->field('*');
+    }
+    public function saleInfo()
+    {
+        return $this->hasOne(Sale::class, 'id', 'sale_id')
+            ->field('*');
+    }
     public function propertyHead()
     {
         return $this->hasOne(PropertyHead::class, 'id', 'property_head_id')