allen 3 years ago
parent
commit
f2868d61f3
2 changed files with 4 additions and 4 deletions
  1. 2 2
      app/admin/controller/Award.php
  2. 2 2
      app/index/controller/Index.php

+ 2 - 2
app/admin/controller/Award.php

@@ -44,7 +44,7 @@ class Award extends Controller
 
         $lists = Db::query("select o.id, u.uid,u.nickname, o.name, o.mobile, o.address, g.name as giftName, o.rank from awards_order as o 
     left join awards_user_info as u on o.uid = u.uid 
-    left join awards_gift as g on o.gift_id = g.id where o.type = 2 order by o.rank asc");
+    left join awards_gift as g on o.gift_id = g.id where o.type = 2 and o.rank > 0 order by o.rank asc");
         $this->assign('lists', $lists);
         $this->fetch();
     }
@@ -62,7 +62,7 @@ class Award extends Controller
 
         $data = Db::query("select u.uid, u.nickname, o.name, o.mobile, o.address, g.name as giftName, o.rank from awards_order as o 
     left join awards_user_info as u on o.uid = u.uid 
-    left join awards_gift as g on o.gift_id = g.id where o.type = 2 order by o.rank asc");
+    left join awards_gift as g on o.gift_id = g.id where o.type = 2 and o.rank > 0 order by o.rank asc");
 
         //实例化
         $objExcel = new \PHPExcel();

+ 2 - 2
app/index/controller/Index.php

@@ -470,7 +470,7 @@ class Index extends Controller
 
         $orders = Db::query("select u.nickname, u.portrait, g.name as giftName from awards_order as o 
     left join awards_user_info as u on o.uid = u.uid 
-    left join awards_gift as g on o.gift_id = g.id where o.type = 2 order by o.rank asc");
+    left join awards_gift as g on o.gift_id = g.id where o.type = 2 and o.rank > 0 order by o.rank asc");
 
         return $this->successResponse([
             'isBeginActivity' => $isBeginActivity,
@@ -638,7 +638,7 @@ where u.portrait != '' and u.portrait is not null  and l.duration > 15 group by
 
         $orders = Db::query("select u.nickname, u.portrait,o.gift_id, g.name as giftName from awards_order as o 
     left join awards_user_info as u on o.uid = u.uid 
-    left join awards_gift as g on o.gift_id = g.id where o.type = 2 order by o.rank asc");
+    left join awards_gift as g on o.gift_id = g.id where o.type = 2 and o.rank > 0 order by o.rank asc");
 
         $isWinAward = 0;
         $giftId = 0;