From 01d6fe5da07b5b5a1e8e98e6132ff4ad3a8c8c35 Mon Sep 17 00:00:00 2001 From: dengbw Date: Wed, 1 Sep 2021 17:29:55 +0800 Subject: [PATCH] bobing_901_7 bobing_901_8 --- api/controllers/wxapp/bobing/Bobing.php | 19 ++++++++++++++----- api/libraries/bobing/Bo.php | 4 +--- common/models/bobing/Bobing_user_model.php | 2 +- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/api/controllers/wxapp/bobing/Bobing.php b/api/controllers/wxapp/bobing/Bobing.php index 1551a529..a624e317 100644 --- a/api/controllers/wxapp/bobing/Bobing.php +++ b/api/controllers/wxapp/bobing/Bobing.php @@ -83,6 +83,13 @@ class Bobing extends Wxapp $this->check_game_date(); $cf_uid = intval($this->input_param('cf_uid'));//要助力id $this->uid == $cf_uid && $cf_uid = 0; + $re_cu = ''; + if ($cf_uid) { + $re_cu = $this->app_user_model->get(array('id' => $cf_uid)); + if (!$re_cu) { + throw new Hd_exception('无此用户', API_CODE_FAIL); + } + } //$cf_uid = 14; $this->load->library('bobing/bo'); $this->bo->uid = $this->uid; @@ -124,7 +131,7 @@ class Bobing extends Wxapp $data['level'] = $result['level']; $data['bo_title'] = $result['level_name'] . ' + ' . $result['credit']; $data['valid_nums'] = $valid_nums; - $data['top_title'] = $this->get_top_title($cf_uid); + $data['top_title'] = $this->get_top_title($cf_uid, $re_cu); return $data; } @@ -161,14 +168,16 @@ class Bobing extends Wxapp /** * Notes:博饼顶部标题 - * Created on: 2021/8/17 10:14 + * Created on: 2021/9/1 17:21 * Created by: dengbw - * @return array + * @param $cf_uid + * @param string $reU + * @return string */ - private function get_top_title($cf_uid) + private function get_top_title($cf_uid, $reU = '') { if ($cf_uid) { - $reU = $this->app_user_model->get(array('id' => $cf_uid)); + !$reU && $reU = $this->app_user_model->get(array('id' => $cf_uid)); $top_title = $reU['nickname'] ? $reU['nickname'] . '的桌子' : '未知用户的桌子'; } else { $credit = $ranking = 0; diff --git a/api/libraries/bobing/Bo.php b/api/libraries/bobing/Bo.php index e7b0f99b..6dc46bd8 100644 --- a/api/libraries/bobing/Bo.php +++ b/api/libraries/bobing/Bo.php @@ -134,7 +134,7 @@ class Bo extends Base if (!$data['car_gold'] && ($hong_bao_day < $this->appConfig['hong_bao_day'])) {//无购车金时抽红包与红包小于每日设定值 if ($this->appConfig['ratio_hong_bao'] && $this->appConfig['ratio_hong_bao'] >= rand(1, 100)) {//红包概率 $re_l = $this->ci->bobing_logs_model->get(array('app_id' => $data['app_id'], 'act_key' => $data['act_key'], 'uid' => $data['uid'] - , 'cf_uid' => $data['cf_uid'])); + , 'cf_uid' => $data['cf_uid'], 'hong_bao >' => 0)); if (!$re_l) {//帮博时只能在一个用户上中一次红包 $hong_bao = '0.3'; //'0.' . rand(30, 68);//0.30到0.68红包 $data['hong_bao'] = $hong_bao; @@ -197,7 +197,6 @@ class Bo extends Base $map['bo_date'] = $data['bo_date']; $re_c = $this->ci->bobing_user_credit_model->get($map); if ($re_c) { - //if ($this->ci->bobing_user_credit_model->cache('get', array($map, 'id'))) { $this->ci->bobing_user_credit_model->update(array("credit = credit+{$data['credit']}" => null), $map); } else { $map['credit'] = $data['credit']; @@ -211,7 +210,6 @@ class Bo extends Base $map_my['bo_date'] = $data['bo_date']; $re_c = $this->ci->bobing_user_credit_model->get($map_my); if ($re_c) { - //if ($this->ci->bobing_user_credit_model->cache('get', array($map_my, 'id'))) { $this->ci->bobing_user_credit_model->update(array("credit = credit+{$data['credit']}" => null), $map_my); } else { $map_my['credit'] = $data['credit']; diff --git a/common/models/bobing/Bobing_user_model.php b/common/models/bobing/Bobing_user_model.php index 5b2f998c..ab820341 100644 --- a/common/models/bobing/Bobing_user_model.php +++ b/common/models/bobing/Bobing_user_model.php @@ -36,7 +36,7 @@ class Bobing_user_model extends Base_model $config = array( 'title' => 'LiChe博饼', 'content' => '2021闽南博饼嘉年华', 'game_start_date' => '2021-07-20', 'game_end_date' => '2021-09-31', 'group' => array('title' => '添加小狸', 'btn' => '加小狸企业微信', 'tips' => '通过后送288幸运分'), - 'app_id' => 1, 'act_key' => $act_key, 'kz_nums' => 25, 'zl_nums' => 15, 'wxqy_nums' => 288, 'ratio_hong_bao' => 50, 'ratio_car_gold' => 50, + 'app_id' => 1, 'act_key' => $act_key, 'kz_nums' => 25, 'zl_nums' => 20, 'wxqy_nums' => 288, 'ratio_hong_bao' => 50, 'ratio_car_gold' => 50, 'max_car_gold' => 500, 'buy_car_gold' => 500, 'hong_bao_day' => 1000, 'lottery_nums' => 10, 'rule' => array('title' => '活动流程及规则', 'content' => '
一、活动时间:2021年9月9日10:00-2021年10月8日15:00