|
|
@@ -319,7 +319,7 @@ class Index extends Controller
|
|
|
->order('l.create_at', 'desc')
|
|
|
->order('l.number', 'desc')
|
|
|
->order('l.duration', 'asc')
|
|
|
- ->limit(15)
|
|
|
+ ->limit(50)
|
|
|
->select();
|
|
|
|
|
|
$userInfo = Db::table('awards_user_task_log')->alias('l')
|
|
|
@@ -394,7 +394,7 @@ class Index extends Controller
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 获取中奖信息接口
|
|
|
+ * 获取轮播中奖接口
|
|
|
* @throws FuncNotFoundException
|
|
|
* @throws ClassNotFoundException
|
|
|
* @throws DbException
|
|
|
@@ -402,7 +402,7 @@ class Index extends Controller
|
|
|
* @throws DataNotFoundException
|
|
|
* @return mixed
|
|
|
*/
|
|
|
- public function getWinAward() {
|
|
|
+ public function getRotationAward() {
|
|
|
|
|
|
$activity = Db::table('awards_activity')->where('begin_at', '<=', time())
|
|
|
->where('end_at', '>=', time())->find();
|
|
|
@@ -420,6 +420,70 @@ class Index extends Controller
|
|
|
return $this->successResponse($orders);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 排行中奖接口
|
|
|
+ * @throws FuncNotFoundException
|
|
|
+ * @throws ClassNotFoundException
|
|
|
+ * @throws DbException
|
|
|
+ * @throws ModelNotFoundException
|
|
|
+ * @throws DataNotFoundException
|
|
|
+ * @return mixed
|
|
|
+ */
|
|
|
+ public function getRankingWinAward() {
|
|
|
+
|
|
|
+ $ranking = Db::table('awards_user_task_log')->alias("l")
|
|
|
+ ->leftJoin('awards_user_info u', 'l.uid = u.uid')
|
|
|
+ ->field(['u.nickname', 'u.portrait', 'u.uid', 'l.duration', 'l.number'])
|
|
|
+ ->order('l.number', 'desc')
|
|
|
+ ->order('l.duration', 'asc')
|
|
|
+ ->limit(50)
|
|
|
+ ->select();
|
|
|
+
|
|
|
+ $isWinAward = 0;
|
|
|
+ foreach ($ranking as $val) {
|
|
|
+ if ($val['uid'] == Safe::$user['uid']) {
|
|
|
+ $isWinAward = 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return $this->successResponse([
|
|
|
+ 'isWinAward' => $isWinAward,
|
|
|
+ 'giftId' => 0
|
|
|
+ ]);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 抽奖接口
|
|
|
+ * @throws FuncNotFoundException
|
|
|
+ * @throws ClassNotFoundException
|
|
|
+ * @throws DbException
|
|
|
+ * @throws ModelNotFoundException
|
|
|
+ * @throws DataNotFoundException
|
|
|
+ * @return mixed
|
|
|
+ */
|
|
|
+ public function getLuckDraw()
|
|
|
+ {
|
|
|
+ $ranking = Db::table('awards_user_task_log')->alias("l")
|
|
|
+ ->leftJoin('awards_user_info u', 'l.uid = u.uid')
|
|
|
+ ->field(['u.nickname', 'u.portrait', 'u.uid', 'l.duration', 'l.number'])
|
|
|
+ ->order('l.number', 'desc')
|
|
|
+ ->order('l.duration', 'asc')
|
|
|
+ ->limit(50)
|
|
|
+ ->select();
|
|
|
+
|
|
|
+ $isWinAward = 0;
|
|
|
+ foreach ($ranking as $val) {
|
|
|
+ if ($val['uid'] == Safe::$user['uid']) {
|
|
|
+ $isWinAward = 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return $this->successResponse([
|
|
|
+ 'isWinAward' => $isWinAward,
|
|
|
+ 'giftId' => 0
|
|
|
+ ]);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 品牌任务关注接口
|
|
|
* @throws FuncNotFoundException
|