api_bobing_915

This commit is contained in:
dengbw
2021-09-15 10:06:52 +08:00
parent 7161233eb9
commit 2a6268fb67
+17 -5
View File
@@ -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) . '<br>';
if ($res_u) {
echo '[' . $res_u[$key]['nickname'] . ']本次加了:' . $credit . ',今天总分:' . ($re_u['credit'] + $credit) . '<br>';
} else {
echo 'uid(' . $uid . ')本次加了:' . $credit . ',今天总分:' . ($re_u['credit'] + $credit) . '<br>';
}
}
}
}