Prechádzať zdrojové kódy

发布求购出售信息

afa 6 mesiacov pred
rodič
commit
56fef7e878

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

@@ -32,7 +32,9 @@ class Teac extends Api
              ->where('product_teac.status', ProductTeac::Normal)->where('type_id', $type_id)
              ->order('create_time desc')
              ->paginate($this->pageSize);
-        
+        foreach ($list as &$item) {
+            $item->users->avatar = !empty($item->users->avatar)? $item->users->avatar:$this->request->domain().'/assets/img/logo.png'; // 头像
+        }
         $this->success('ok', $list);
     }
 

+ 1 - 1
application/api/logic/TeacLogin.php

@@ -26,7 +26,7 @@ class TeacLogin
     */
     public static  function setCreateTrade(int $uid, float $price, int $stock, int $typeId, float $frozen):object
     {
-        $rows = ProductTeac::where('user_id', $uid)->where('status', ProductTeac::Normal)->find();
+        $rows = ProductTeac::where('user_id', $uid)->where('type_id', $typeId)->where('status', ProductTeac::Normal)->find();
         if($rows)  throw new Exception(__("你有未完成的求购订单、不能重复发布"));
 
         //添加订单信息