allen 3 年之前
父節點
當前提交
7549b12df6
共有 1 個文件被更改,包括 39 次插入0 次删除
  1. 39 0
      app/index/controller/Index.php

+ 39 - 0
app/index/controller/Index.php

@@ -435,6 +435,45 @@ class Index extends Controller
         return $uuid ;
     }
 
+    /**
+     * 彩蛋中奖列表
+     * @return mixed|Json
+     * @throws DataNotFoundException
+     * @throws DbException
+     * @throws ModelNotFoundException
+     */
+    public function easterEggDrawList()
+    {
+        $orders = Db::table('awards_order')->alias('o')
+            ->leftJoin('awards_user_info u', 'o.uid = u.uid')
+            ->leftJoin('awards_gift g', 'o.gift_id = g.id')
+            ->field(['u.nickname', 'g.name as giftName'])
+            ->where('o.type', 1)
+            ->select();
+
+        return $this->successResponse($orders);
+    }
+
+    public function rankingDrawList()
+    {
+        $activity = Db::table('awards_activity')->where('end_at', '<', time())->find();
+        $isBeginActivity = 1;
+        if ($activity) {
+            $isBeginActivity = 0;
+        }
+
+        $orders = [];
+        if ($isBeginActivity == 0) {
+            $orders = Db::query("select u.nickname, u.portrait, l.uid, l.duration, l.number from awards_user_task_log as l left join awards_user_info as u on l.uid = u.uid
+where u.portrait != '' and u.portrait is not null and l.number >= 15 group by l.uid order by l.id desc limit 50");
+        }
+
+        return $this->successResponse([
+            'isBeginActivity' => $isBeginActivity,
+            'list' => $orders
+        ]);
+    }
+
     /**
      * 头号排行接口
      * @throws FuncNotFoundException