afa преди 6 месеца
родител
ревизия
8770c52b27
променени са 2 файла, в които са добавени 2 реда и са изтрити 2 реда
  1. 1 1
      application/api/controller/Teac.php
  2. 1 1
      application/common/model/ProductTeac.php

+ 1 - 1
application/api/controller/Teac.php

@@ -29,7 +29,7 @@ class Teac extends Api
         if(!in_array($type_id, [ProductTeac::Buying, ProductTeac::Sell])) $this->error('类型错误');
            
         $list = $productTeac->with('users')
-             ->where('status', ProductTeac::Normal)->where('type_id', $type_id)
+             ->where('product_teac.status', ProductTeac::Normal)->where('type_id', $type_id)
              ->order('create_time desc')
              ->paginate($this->pageSize);
         

+ 1 - 1
application/common/model/ProductTeac.php

@@ -66,7 +66,7 @@ class ProductTeac extends Model
     //用户 user_id
     public function users()
     {
-        return $this->hasOne('UserModel', 'id', 'user_id', [], 'LEFT')->field('id,address,nickname,avatar')->setEagerlyType(0);
+        return $this->hasOne('UserModel', 'id', 'user_id', [], 'LEFT')->field('id,address,nickname,avatar');
     }