diff --git a/api/controllers/plan/Bobing.php b/api/controllers/plan/Bobing.php
index d681dd82..c0f4cf29 100644
--- a/api/controllers/plan/Bobing.php
+++ b/api/controllers/plan/Bobing.php
@@ -75,4 +75,31 @@ class Bobing extends HD_Controller
return;
}
}
+
+ /**
+ * Notes:
+ * Created on: 2021/9/8 11:59
+ * Created by: dengbw
+ */
+ public function mj()
+ {
+ $hour = date('H');
+ if ($hour > 9 && $hour > 22) {
+ echo '9点到22点博';
+ return;
+ }
+ if ($this->appConfig['game_start_date'] > date('Y-m-d')) {
+ echo '博饼未开始';
+ return;
+ }
+ $date = date('Y-m-d', strtotime('+1 day'));
+ if ($this->appConfig['game_end_date'] < $date) {
+ echo '博饼已结束';
+ return;
+ }
+ $uid = 14;
+ $credit = rand(50, 120);
+ $this->mdBobingUser->update(array('credit' => $credit), array('uid' => $uid,
+ 'app_id' => $this->appConfig['app_id'], 'act_key' => $this->appConfig['act_key']));
+ }
}
diff --git a/api/controllers/wxapp/bobing/Bobing.php b/api/controllers/wxapp/bobing/Bobing.php
index 44e8a956..858c58b2 100644
--- a/api/controllers/wxapp/bobing/Bobing.php
+++ b/api/controllers/wxapp/bobing/Bobing.php
@@ -121,10 +121,10 @@ class Bobing extends Wxapp
$status = 3;
$data['car_gold'] = $result['car_gold'];
$log .= "和{$result['car_gold']}元购车金";
- } else if ($result['hong_bao'] > 0) {
+ }
+ if ($cf_uid) {
$status = 4;
$data['hong_bao_url'] = http_host_com('home') . "/h5/hongbao?id={$result['lid']}&uid={$this->myuid}";
- $log .= ",额外博到现金红包";
}
$data['log'] = $log;
$data['status'] = $status;
@@ -177,7 +177,7 @@ class Bobing extends Wxapp
$valid_nums = array('title' => '剩余助力次数:', 'value' => $zl_nums <= 0 ? 0 : $zl_nums);
} else {
$kz_nums = $this->mdBobingLogs->count(array('app_id' => $this->appConfig['app_id'], 'act_key' => $this->appConfig['act_key']
- , 'uid' => $this->myuid, 'type' => 0));
+ , 'uid' => $this->myuid, 'type' => 0, 'bo_date' => date('Y-m-d')));
$kz_nums = intval($this->appConfig['kz_nums'] - $kz_nums);//剩下开桌博饼数
$valid_nums = array('title' => '剩余博饼次数:', 'value' => $kz_nums <= 0 ? 0 : $kz_nums);
}
@@ -197,7 +197,7 @@ class Bobing extends Wxapp
$top_titles = array();
if ($cf_uid) {
$reU = $this->app_user_model->get(array('id' => $cf_uid));
- $top_title = $reU['nickname'] ? $reU['nickname'] . '的桌子' : '未知用户的桌子';
+ $top_title = $reU['nickname'] ? $reU['nickname'] . '的博饼桌' : '未知用户的博饼桌';
$top_titles[] = array('title' => $top_title, 'url' => '');
} else {
$where = array('app_id' => $this->appConfig['app_id'], 'act_key' => $this->appConfig['act_key'], 'bo_date' => date('Y-m-d'));
@@ -284,9 +284,6 @@ class Bobing extends Wxapp
} else if ($value['car_gold'] > 0) {
$content = $nickname . "为桌长博到{$value['car_gold']}元购车金";
}
- if ($value['hong_bao'] > 0) {
- $content = $content ? ",额外博到现金红包" : $nickname . '博到现金红包';
- }
} else if ($value['type'] == 2) {
$content = "桌长加企业微信得到{$this->appConfig['wxqy_nums']}购车金";
}
diff --git a/api/controllers/wxapp/bobing/Home.php b/api/controllers/wxapp/bobing/Home.php
index f9ee5f6a..92054d07 100644
--- a/api/controllers/wxapp/bobing/Home.php
+++ b/api/controllers/wxapp/bobing/Home.php
@@ -311,7 +311,7 @@ class Home extends Wxapp
$credit = $re_u['credit'];
$car_gold = $re_u['car_gold'] + $re_u['buy_car_gold'] + $re_u['lotter_gold'];
if ($re_u['buy_car_gold'] > 0) {
- $tips = '
您已添加客服领取到' . $re_u['buy_car_gold'] . '元购车金
';
+ $tips = '您已添加顾问领取到' . intval($re_u['buy_car_gold']) . '元购车金
';
}
if ($credit) {
$where = array('app_id' => $this->appConfig['app_id'], 'act_key' => $this->appConfig['act_key']);
diff --git a/api/libraries/bobing/Bo.php b/api/libraries/bobing/Bo.php
index 3475eadb..f6f29467 100644
--- a/api/libraries/bobing/Bo.php
+++ b/api/libraries/bobing/Bo.php
@@ -29,26 +29,27 @@ class Bo extends Base
*/
public function kz_bo()
{
- if ($this->valid_nums <= 0) {
- $content = '您的博饼次数已经用完啦~
立即邀请好友助力博饼,
获得更多购车金,
冲击汽车大奖!!!
';
- $popup = array('title' => '邀请好友', 'content' => $content, 'btn' => array('title' => '立即邀请', 'url' => '/bobing/pages/game/invite/index'));
- return array('status' => 1, 'popup' => $popup);
- }
$data['app_id'] = $this->appConfig['app_id'];
$data['act_key'] = $this->appConfig['act_key'];
- $data['uid'] = $this->uid;
+ $re_u = $this->ci->bobing_user_model->get(array('app_id' => $data['app_id'], 'act_key' => $data['act_key'], 'uid' => $this->uid));
+ $all_car_gold = $re_u['car_gold'] + $re_u['buy_car_gold'] + $re_u['lotter_gold'];
+ if ($this->valid_nums <= 0) {
+ $content = '今天博饼次数已经用完啦~
已累计获得' . $all_car_gold . '元购车金
明天还有' . $this->appConfig['kz_nums'] . '次博饼机会
立即邀请好友助力博饼
获得更多购车金
冲击汽车大奖!!!
';
+ $popup = array('title' => '邀请好友', 'content' => $content, 'btn' => array('title' => '邀请好友助力', 'url' => '/bobing/pages/game/invite/index'));
+ return array('status' => 1, 'popup' => $popup);
+ }
$this->ci->load->library('bobing/dice');
$this->ci->dice->init();
$dices = $this->ci->dice->getResultArr();
$level = $this->ci->dice->getResultLevel();
$credit = $this->ci->dice->getcredit($level);
$level_name = $this->ci->dice->getResultName();
- $re_u = $this->ci->bobing_user_model->get(array('app_id' => $data['app_id'], 'act_key' => $data['act_key'], 'uid' => $this->uid));
if ($this->car_id == 15 && $level >= 6) {//ex1用户博到状元时设为罚黑
$dices = $this->dicesAry[rand(1, 6)];
$level = $credit = 0;
$level_name = '罚黑';
}
+ $data['uid'] = $this->uid;
$data['dices'] = implode(',', $dices);
$data['level'] = $level;
$data['credit'] = $credit;
@@ -59,15 +60,19 @@ class Bo extends Base
$data['c_time'] = time();
$popup = '';
if ($re_u['car_gold'] < $this->appConfig['max_car_gold']) {//购车金小于购车金设定值
- if ($this->appConfig['ratio_car_gold_kz'] && $this->appConfig['ratio_car_gold_kz'] <= rand(1, 5)) {//购车金概率
+ if ($this->appConfig['ratio_car_gold_kz'] && ($this->appConfig['ratio_car_gold_kz'] <= rand(1, 100))) {//购车金概率
//$car_gold = $this->carGoldAry[rand(1, 7)];
$car_gold = rand(25, 35);
if (($car_gold + $re_u['car_gold']) > $this->appConfig['max_car_gold']) {//如果购车金大于设定值,那么本次增加到最大值
$car_gold = $this->appConfig['max_car_gold'] - $re_u['car_gold'];
}
$data['car_gold'] = $car_gold;
- $all_car_gold = $car_gold + $re_u['car_gold'] + $re_u['buy_car_gold'] + $re_u['lotter_gold'];
- $content = '博到 ' . $car_gold . ' 元购车金!
您已累计博得
' . $all_car_gold . ' 元购车金
';
+ $content = '博到 ' . $car_gold . ' 元购车金!
+
您已累计获得
' . $all_car_gold . ' 元购车金
购车金可无限叠加使用
';
+ $nums = $this->valid_nums - 1;
+ if ($nums > 0) {
+ $content .= '今天还可再博' . $nums . '次
';
+ }
$popup = array('title' => '恭喜您', 'content' => $content, 'btn' => array('title' => '立即使用购车金', 'url' => '/bobing/pages/game/signUp/index'));
}
}
@@ -95,10 +100,13 @@ class Bo extends Base
$data['uid'] = $this->cf_uid;
$data['cf_uid'] = $this->uid;
if ($this->valid_nums <= 0) {
- $re_u = $this->ci->bobing_user_model->get(array('app_id' => $data['app_id'], 'act_key' => $data['act_key'], 'uid' => $this->uid));
- $credit = intval($re_u['credit']);
- $content = '您已获得' . $credit . '积分,
立即开桌获得更多幸运分,
冲刺购物卡、苹果手机、汽车大奖
';
- $popup = array('title' => '开桌', 'content' => $content, 'btn' => array('title' => '立即开桌', 'url' => '/bobing/pages/index/index'));
+ $re_u2 = $this->ci->bobing_user_model->get(array('app_id' => $data['app_id'], 'act_key' => $data['act_key'], 'uid' => $this->uid));
+ $credit = intval($re_u2['credit']);
+ $sum_credit = $this->ci->bobing_logs_model->sum('credit', array('app_id' => $data['app_id'], 'act_key' => $data['act_key'], 'uid' => $data['uid'], 'cf_uid' => $data['cf_uid']));
+ $sum_car_gold = $this->ci->bobing_logs_model->sum('car_gold', array('app_id' => $data['app_id'], 'act_key' => $data['act_key'], 'uid' => $data['uid'], 'cf_uid' => $data['cf_uid']));
+ $content = '您已帮好友博到
' . $sum_credit['credit'] . ' 幸运分和
+' . intval($sum_car_gold['car_gold']) . ' 购车金
同时您还获得 ' . $credit . ' 积分
立即开桌获得更多幸运分
冲刺汽车大奖!
';
+ $popup = array('title' => '开桌', 'content' => $content, 'btn' => array('title' => '我也要开桌', 'url' => '/bobing/pages/index/index'));
return array('status' => 2, 'popup' => $popup);
}
$this->ci->load->library('bobing/dice');
@@ -122,25 +130,25 @@ class Bo extends Base
$data['type'] = 1;
$popup = '';
if ($re_u['car_gold'] < $this->appConfig['max_car_gold']) {//购车金小于购车金设定值
- if ($this->appConfig['ratio_car_gold_zl'] && $this->appConfig['ratio_car_gold_zl'] == rand(1, 3)) {//购车金概率
+ if ($this->appConfig['ratio_car_gold_zl'] && ($this->appConfig['ratio_car_gold_zl'] <= rand(1, 100))) {//购车金概率
//$car_gold = $this->carGoldAry[rand(1, 7)];
$car_gold = rand(40, 60);
if (($car_gold + $re_u['car_gold']) > $this->appConfig['max_car_gold']) {//如果购车金大于设定值,那么本次增加到最大值
$car_gold = $this->appConfig['max_car_gold'] - $re_u['car_gold'];
}
$data['car_gold'] = $car_gold;
- $content = '帮助好友博到' . $car_gold . '元购车金和' . $data['credit'] . '幸运分,
您的好友离汽车大奖更进一步了!
';
- $popup = array('title' => '恭喜您', 'content' => $content, 'btn' => array('title' => '我也要开桌博取汽车大奖'
+ $content = '恭喜您
帮好友博到' . $car_gold . '元购车金
';
+ $popup = array('title' => '恭喜您', 'content' => $content, 'btn' => array('title' => '我也要博大奖'
, 'url' => '/bobing/pages/index/index'));
}
}
$hong_bao_day = $this->ci->bobing_user_model->hongBaoDay($data['act_key']);
- 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']
+ if ($hong_bao_day < $this->appConfig['max_hong_bao_day']) {//无购车金时抽红包与红包小于每日设定值
+ if ($this->appConfig['ratio_hong_bao'] && $this->appConfig['ratio_hong_bao'] <= rand(1, 100)) {//红包概率
+ $hb_count = $this->ci->bobing_logs_model->count(array('app_id' => $data['app_id'], 'act_key' => $data['act_key'], 'uid' => $data['uid']
, 'cf_uid' => $data['cf_uid'], 'hong_bao >' => 0));
- if (!$re_l) {//帮博时只能在一个用户上中一次红包
- $hong_bao = '0.3'; //'0.' . rand(30, 68);//0.30到0.68红包
+ if ($hb_count < 2) {//帮博时最多出现两次红包
+ $hong_bao = '0.' . rand(30, 68);
$data['hong_bao'] = $hong_bao;
$data['status'] = 1;
$this->ci->bobing_user_model->hongBaoDay($data['act_key'], $hong_bao);
diff --git a/api/libraries/bobing/Dice.php b/api/libraries/bobing/Dice.php
index dc884ecc..4354fa83 100644
--- a/api/libraries/bobing/Dice.php
+++ b/api/libraries/bobing/Dice.php
@@ -269,11 +269,11 @@ class Dice
self::RESULT_WZDYX => 70, //五子带一秀
self::RESULT_WZ => 60, //五子
self::RESULT_ZY => 50, //状元
- self::RESULT_DT => 20, //对堂
- self::RESULT_SH => 10, //三红
- self::RESULT_SJ => 5, //四进
- self::RESULT_EJ => 2, //二举
- self::RESULT_YX => 1, //一秀
+ self::RESULT_DT => 30, //对堂
+ self::RESULT_SH => 20, //三红
+ self::RESULT_SJ => 15, //四进
+ self::RESULT_EJ => 10, //二举
+ self::RESULT_YX => 5, //一秀
self::RESULT_FH => 0, //罚黑
);
return intval($arr[$level]);
diff --git a/common/models/bobing/Bobing_user_model.php b/common/models/bobing/Bobing_user_model.php
index 20e28308..896ee910 100644
--- a/common/models/bobing/Bobing_user_model.php
+++ b/common/models/bobing/Bobing_user_model.php
@@ -36,37 +36,37 @@ class Bobing_user_model extends Base_model
$config = array(
'title' => 'LiChe博饼', 'content' => '2021闽南博饼嘉年华', 'game_start_date' => '2021-09-01 10:00', 'game_end_date' => '2021-10-08 15:00',
'group' => array('title' => '添加小狸', 'btn' => '加小狸企业微信', 'tips' => '通过后送288幸运分'),
- 'app_id' => 1, 'act_key' => $act_key, 'kz_nums' => 5, 'zl_nums' => 3, 'wxqy_nums' => 500, 'ratio_hong_bao' => 50, 'ratio_car_gold_kz' => 3, 'ratio_car_gold_zl' => 1,
- 'max_car_gold' => 500, 'buy_car_gold' => 500, 'hong_bao_day' => 500, 'lottery_nums' => 10, 'lotter_gold' => 1000,
+ 'app_id' => 1, 'act_key' => $act_key, 'kz_nums' => 5, 'zl_nums' => 5, 'wxqy_nums' => 500, 'ratio_hong_bao' => 40, 'ratio_car_gold_kz' => 60, 'ratio_car_gold_zl' => 40,
+ 'max_car_gold' => 500, 'buy_car_gold' => 500, 'max_hong_bao_day' => 500, 'lottery_nums' => 5, 'lotter_gold' => 1000,
'rule' => array('title' => '活动流程及规则', 'content' => '
一、活动时间:2021年9月9日10:00-2021年10月8日15:00
二、活动流程及规则
-1. 开桌用户可以直接获得5次博饼次数,博饼次数用完后,通过邀请助力用户获得3次博饼次数为其博饼,双方可获得如下奖励
-(1)开桌用户:
- ① 获得购车金:助力用户每次助力博饼,随机为开桌用户获得一定金额的购车金,购车金可以累计使用;
- ② 获得幸运分: 助力用户每次助力博饼,根据博出的结果,为开桌用户获得不同的幸运分:一秀5分、二举10分、四进15分、三红20分、对堂30分、状元50分
-五子60分、五子带一秀70分、五红80分、六博黑90分、六博红100分、状元插金华120分
-(2)助力用户:
- ① 获得购车金:助力用户每次助力博饼,随机获得现金红包,最高可获得100元,现金红包直接进入获奖用户的微信钱包;
- ② 获得幸运分: 助力用户每次助力博饼,根据博出的结果,同时为自己获得幸运分:一秀5分、二举10分、四进15分、三红20分、对堂30分、状元50分
-五子60分、五子带一秀70分、五红80分、六博黑90分、六博红100分、状元插金华120分
-2. 所有用户均可通过添加狸车顾问微信,直接领取500元购车金(购车金可以与博饼获得的购车金共同累计,一位用户活动期间只能领取一次)
-3. 每日博饼幸运分进入日排行榜,前10名可额外获得购车金1000元(购车金可以与博饼获得的购车金共同累计,一位用户活动期间只能获得一次日排行奖励)
-4. 活动期间博饼幸运分进入总排行榜,第一名获得新能源汽车大奖(车辆所有权,购置税自理)
+1. 用户通过开桌每天有5次博饼机会,博饼机会用完后,可通过邀请好友助力博饼(每位好友最多可助力5次),参与用户可获得如下奖励:
+(1)开桌用户
+ ① 获得购车金: 每次博饼,有几率获得随机金额的购车金。好友助力博饼,有几率帮其获得随机金额的购车金,购车金可以累加使用;
+ ② 获得幸运分: 每次助力博饼,根据博出的结果,可获得相应的幸运分:一秀5分、二举10分、四进15分、三红20分、对堂30分、状元50分、
+ 五子60分、五子带一秀70分、五红80分、六勃黑90分、六勃红100分、状元插金花120分;
+(2)助力用户
+ ① 获得现金红包:每次助力博饼,随机掉落现金红包,打开后有几率获得最高100元现金,现金直接转入获奖用户的微信钱包;
+ ② 获得幸运分: 每次助力博饼,根据博出的结果,可同时为自己获得相应的幸运分:一秀5分、二举10分、四进15分、三红20分、对堂30分、状元50分、
+ 五子60分、五子带一秀70分、五红80分、六勃黑90分、六勃红100分、状元插金花120分;
+2. 所有用户均可通过添加狸车顾问微信,直接领取500元购车金(购车金可以与博饼获得的购车金共同累计,一位用户活动期间只能领取一次)。
+3. 每日博饼幸运分进入日排行榜,前五名可额外获得1000元购车金(购车金可以与博饼获得的购车金共同累计,一位用户活动期间只能获得一次日排行奖励)
+4. 活动期间博饼幸运分进入总排行榜,第一名获得新能源汽车大奖(车辆所有权、个人偶然所得税自理)
5. 每日排行、总排行榜若出现幸运分相同的情况,则以用户首次进行博饼的时间进行排序依据,越早参加博饼的用户,排名越靠前;
6. 关于购车金
(1)活动期间用户博取的购车金、领取的购车金以及排名奖励的购车金均可累计使用;
-(2)使用范围为:泉州、漳州、厦门指定的经销商(点击查看经销商列表)
+(2)使用范围为:泉州、漳州、厦门指定的经销商
(3)使用的品牌车型为:
-川汽野马-雷丁芒果
-东风新能源-EX1
-哪吒-哪吒V
-零跑-零跑T03、S01、C11
-欧拉-黑猫、白猫、好猫
-奇瑞新能源-小蚂蚁
+ 川汽野马-雷丁芒果
+ 东风新能源-EX1
+ 哪吒-哪吒V
+ 零跑-零跑T03、S01、C11
+ 欧拉-黑猫、白猫、好猫
+ 奇瑞新能源-小蚂蚁
(4)使用购车金时,用户可在经销商处协商好购车价后,再提出购车金抵扣,不影响正常车辆优惠政策;
-7. 任何问题均可联系新能源汽车顾问解答 (联系新能源汽车顾问按钮)
-8. 在法律允许范围内,主办方拥有对本次活动的最终解释权。
'),
+6. 任何问题均可联系新能源汽车顾问解答。
+7. 在法律允许范围内,主办方拥有对本次活动的最终解释权。
'),
);
}
return $config;
@@ -91,10 +91,10 @@ class Bobing_user_model extends Base_model
if ($id == 15) {//15ex1 13雷丁
$url_id .= 'ex1-';
}
- $v = '?0907';
+ $v = '?0908';
$imgs['banner'] = $url_id . 'banner.jpg' . $v;
//公用头图
- $imgs['banner2'] = $url_id . 'banner2.jpg' . $v;
+ $imgs['banner2'] = $url_id . 'banner2.png' . $v;
//邀请头图
$imgs['invite_theme'] = $url_id . 'invite-theme.jpg' . $v;
//邀请海报生成图
diff --git a/home/controllers/h5/Hongbao.php b/home/controllers/h5/Hongbao.php
index 893bef49..31125678 100644
--- a/home/controllers/h5/Hongbao.php
+++ b/home/controllers/h5/Hongbao.php
@@ -23,23 +23,27 @@ class Hongbao extends CI_Controller
$params = $this->input->get();
// $params['uid'] = 14;
// $params['id'] = 828932;
- $data = array('code' => 400, 'title' => '领取失败', 'msg' => '');
+ $data = array('code' => 400, 'title' => '领取成功', 'msg' => '恭喜您领到了一年的好运气');
+ $msg = '';
if (!$params['id'] || !$params['uid']) {
- $data['msg'] = '参数错误!';
+ $msg = '参数错误!';
} else {
$this->uid = intval($params['uid']);
$id = intval($params['id']);
$re_l = $this->mdBobingLogs->get(array('id' => $id));
- if (!$re_l || $re_l['status'] == 0 || $re_l['hong_bao'] <= 0) {
- $data['msg'] = '条件不符合!';
+ if (!$re_l || $re_l['status'] == 0) {
+ $msg = '条件不符合!';
+ }
+ if ($re_l['hong_bao'] <= 0) {
+ $msg = '空的现金红包!';
}
if ($re_l['status'] == 2) {
- $data['msg'] = '您已领取过了!';
+ $msg = '您已领取过了!';
}
if ($re_l['cf_uid'] != $params['uid']) {
- $data['msg'] = 'uid错误!';
+ $msg = 'uid错误!';
}
- if (!$data['msg']) {
+ if (!$msg) {
$url = http_host_com('home') . "/h5/hongbao?id={$id}&uid={$this->uid}";
$params['app_id'] = $re_l['app_id'];
$params['cf_uid'] = $re_l['cf_uid'];
@@ -59,9 +63,9 @@ class Hongbao extends CI_Controller
$this->mdBobingLogs->update(array('status' => 2), array('id' => $id));//设为已领取
$data['title'] = '领取成功';
$data['code'] = 200;
- $data['msg'] = '¥' . $re_l['hong_bao'] . '元';
+ $data['msg'] = '恭喜您领到' . $re_l['hong_bao'] . '元现金,已转入微信零钱~';
} else {
- $data['msg'] = '转帐失败!';
+ //$data['msg'] = '转帐失败!';
}
}
}
diff --git a/home/views/h5/hongbao/index.php b/home/views/h5/hongbao/index.php
index 2c75686d..83903c77 100644
--- a/home/views/h5/hongbao/index.php
+++ b/home/views/h5/hongbao/index.php
@@ -6,20 +6,41 @@
content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
领取红包
+
+
+
-
-
-
-
= $title ?>
-
= $msg ?>
-
- if ($msg == 200) { ?>
-
-

+ if ($code == 200) { ?>
+
+
+ } else { ?>
+
+
+ } ?>
+
+
+
+
+
+
+ = $title ?>
+
+
= $msg ?>
+
+
- } ?>
+
+