Browse Source

获取Nft列表

afa 10 months ago
parent
commit
582b2f73bb

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

@@ -77,7 +77,7 @@ class User extends Api
               ->join("product_transfer z", "a.id = z.order_id AND a.status=2", "left") //转让
               ->join("product_area d", "d.id = a.area_id", "left") //地区
               ->field('a.id as order_id,a.product_id,'.'b.'.$this->lan.'_name as name,b.images as img_url,a.price,a.status,a.type_id,c.'.$this->lan.'_title as title,z.price as transfer_price,d.address')
-              ->where('a.user_id', 1241)
+              ->where('a.user_id', $this->auth->id)
               ->order('a.id DESC')
               ->paginate($this->pageSize);
         $this->success('', $list);

+ 5 - 4
application/common/model/ProductTransfer.php

@@ -34,7 +34,7 @@ class ProductTransfer extends Model
     ];
 
 
-    //添加转让订单
+    //添加/更新转让订单
     public static function setTransferOrder($uid, $product_id, $area_id, $feeAmount, $params)
     {
         $rows = self::where('order_id', $params['order_id'])->find();
@@ -46,12 +46,14 @@ class ProductTransfer extends Model
             $order_data['fees']       = $feeAmount;
             $order_data['area_id']    = $area_id;
             $order_data['order_id']   = $params['order_id']; //订单ID
-            self::create($order_data);
+            return self::create($order_data);
         }else{
             $rows->status = self::NORMAL;
-            $rows->save();
+            return $rows->save();
         }  
     }
+
+    
     
     //产品
     public function products()
@@ -66,7 +68,6 @@ class ProductTransfer extends Model
     }
 
 
-
     public function getCreateTimeTextAttr($value, $data)
     {
         $value = $value ? $value : (isset($data['create_time']) ? $data['create_time'] : '');