bobing_908_4
This commit is contained in:
+30
-22
@@ -29,26 +29,27 @@ class Bo extends Base
|
||||
*/
|
||||
public function kz_bo()
|
||||
{
|
||||
if ($this->valid_nums <= 0) {
|
||||
$content = '<div>您的博饼次数已经用完啦~</div><div>立即邀请好友助力博饼,</div><div>获得更多购车金,</div><div>冲击汽车大奖!!!</div>';
|
||||
$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 = '<div>今天博饼次数已经用完啦~</div><div>已累计获得<span style="color:#dd4223;">' . $all_car_gold . '</span>元购车金</div><div>明天还有<span style="color:#dd4223;">' . $this->appConfig['kz_nums'] . '</span>次博饼机会</div><div>立即邀请好友助力博饼</div><div>获得更多购车金</div><div>冲击汽车大奖!!!</div>';
|
||||
$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 = '<div>博到 ' . $car_gold . ' 元购车金!</div><div><br></div><div>您已累计博得</div><div> ' . $all_car_gold . ' 元购车金</div>';
|
||||
$content = '<div>博到 <span style="color:#dd4223;">' . $car_gold . '</span> 元购车金!</div>
|
||||
<div><br></div><div>您已累计获得</div><div> <span style="color:#dd4223;">' . $all_car_gold . '</span> 元购车金</div><div>购车金可无限叠加使用</div>';
|
||||
$nums = $this->valid_nums - 1;
|
||||
if ($nums > 0) {
|
||||
$content .= '<div>今天还可再博<span style="color:#dd4223;">' . $nums . '</span>次</div>';
|
||||
}
|
||||
$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 = '<div>您已获得' . $credit . '积分,</div><div>立即开桌获得更多幸运分,</div><div>冲刺购物卡、苹果手机、汽车大奖</div>';
|
||||
$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 = '<div>您已帮好友博到</div><div><span style="color:#dd4223;">' . $sum_credit['credit'] . '</span> 幸运分和
|
||||
<span style="color:#dd4223;">' . intval($sum_car_gold['car_gold']) . '</span> 购车金</div><div>同时您还获得 <span style="color:#dd4223;">' . $credit . '</span> 积分</div><div>立即开桌获得更多幸运分</div><div>冲刺汽车大奖!</div>';
|
||||
$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 = '<div>帮助好友博到' . $car_gold . '元购车金和' . $data['credit'] . '幸运分,</div><div>您的好友离汽车大奖更进一步了!</div>';
|
||||
$popup = array('title' => '恭喜您', 'content' => $content, 'btn' => array('title' => '我也要开桌博取汽车大奖'
|
||||
$content = '<div style="font-weight:bold;">恭喜您</div><div>帮好友博到' . $car_gold . '元购车金</div>';
|
||||
$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);
|
||||
|
||||
@@ -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]);
|
||||
|
||||
Reference in New Issue
Block a user