Browse Source

状态统计

afa 9 months ago
parent
commit
fa2055ac70
2 changed files with 21 additions and 3 deletions
  1. 2 2
      application/api/controller/Home.php
  2. 19 1
      application/api/controller/User.php

+ 2 - 2
application/api/controller/Home.php

@@ -71,8 +71,8 @@ class Home extends Api
     {
         //更新库存
         $productPopular::setUpdateStatus();
-        $resp['product_list']  = $productPopular->with('productsList')->where('product_popular.status', '<', $productPopular::STOP)->limit(2)
-           ->order('weigh desc,start_time asc')->select();
+        $resp['product_list']  = $productPopular->with('productsList')->where('product_popular.status', '<', $productPopular::STOP)
+        ->order('weigh desc,start_time asc')->select(); //$this->pageSize)
         
         // 转让 
         $resp['transfer_list'] = $productTransfer->alias('a')

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

@@ -84,7 +84,25 @@ class User extends Api
         $this->success('', $list);
     }
 
-
+    /**
+     * 获取我的Nft列表   
+     * param int $type_id 0总览 1转让中 2已转让 3存储中 4已赠送 5已提货
+     * @return void
+     */
+    public function getMyNftList(ProductOrder $productOrder)
+    {
+        $typeId = $this->request->post('type_id/d', 0);
+        $where = self::getNftWhere($typeId, $productOrder);
+        $list = $productOrder->alias('a')
+              ->join("product_list b", "b.id = a.product_id", "left")
+              ->field('a.id as order_id,a.product_id,'.'b.'.$this->lan.'_name as name,b.thum as img_url,a.price,a.status,a.type_id, count(a.num) as hold_num')
+              ->where('a.user_id', $this->auth->id)
+              ->group('a.product_id')
+              ->where($where)
+              ->order('a.id DESC')
+              ->paginate($this->pageSize);
+        $this->success('', $list);
+    }
 
     /**
      * 余额记录信息