From 2a6268fb670213736e22dcc9440991bc7f294094 Mon Sep 17 00:00:00 2001 From: dengbw Date: Wed, 15 Sep 2021 10:06:52 +0800 Subject: [PATCH] api_bobing_915 --- api/controllers/plan/Bobing.php | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/api/controllers/plan/Bobing.php b/api/controllers/plan/Bobing.php index 19debccc..717205a6 100644 --- a/api/controllers/plan/Bobing.php +++ b/api/controllers/plan/Bobing.php @@ -137,10 +137,13 @@ class Bobing extends HD_Controller */ public function mj_day() { - $hour = date('H'); - if ($hour < 9 || $hour > 22) { - echo '9点到22点博'; - return; + $params = $this->input->get(); + if (!$params['sd']) { + $hour = date('H'); + if ($hour < 9 || $hour > 22) { + echo '9点到22点博'; + return; + } } if ($this->appConfig['game_start_date'] > date('Y-m-d H:i')) { echo '博饼未开始'; @@ -167,6 +170,11 @@ class Bobing extends HD_Controller $credits = array(1 => 30, 2 => 50, 3 => 60, 4 => 70, 5 => 50, 6 => 30, 7 => 20, 8 => 15); $date = date('Y-m-d'); $uids_day = $uids[$date]; + $res_u = ''; + if ($params['sd']) {//查找今日要中奖用户 + $this->load->service("app/user_service", array("app_id" => $this->appConfig['app_id'])); + $res_u = $this->user_service->select(array('id in (' . implode(',', $uids_day) . ')' => null), "id asc", 0, 0, 'nickname'); + } foreach ($uids_day as $key => $value) { $where = array('app_id' => $this->appConfig['app_id'], 'act_key' => $this->appConfig['act_key']); $uid = $value; @@ -188,7 +196,11 @@ class Bobing extends HD_Controller $where['c_time'] = time(); $this->mdBobingUserCredit->add($where); } - echo 'uid(' . $uid . ')本次加了:' . $credit . ',今天总分:' . ($re_u['credit'] + $credit) . '
'; + if ($res_u) { + echo '[' . $res_u[$key]['nickname'] . ']本次加了:' . $credit . ',今天总分:' . ($re_u['credit'] + $credit) . '
'; + } else { + echo 'uid(' . $uid . ')本次加了:' . $credit . ',今天总分:' . ($re_u['credit'] + $credit) . '
'; + } } } }