bobing_901_6

This commit is contained in:
dengbw
2021-09-01 16:56:25 +08:00
committed by lccsw
parent a88f97ded9
commit a84df25f5a
4 changed files with 56 additions and 41 deletions
+20 -16
View File
@@ -32,13 +32,13 @@ class Bo extends Base
$popup = array('title' => '邀请好友', 'content' => $content, 'btn' => array('title' => '立即邀请', 'url' => '/bobing/pages/game/invite/index'));
return array('status' => 1, 'popup' => $popup);
}
$mc = &load_cache();
$key = 'LiChe_bobing_' . $this->act_key . $this->app_id . $this->uid;
$timeout = $mc->get($key);
if ($timeout && (time() - $timeout) < 2) {
return array('status' => API_CODE_FAIL, 'content' => '您操作太快了,速度越慢越能博到状元,刷新页面再试试');
}
$mc->save($key, time());
// $mc = &load_cache();
// $key = 'LiChe_bobing_' . $this->act_key . $this->app_id . $this->uid;
// $timeout = $mc->get($key);
// if ($timeout && (time() - $timeout) < 2) {
// return array('status' => API_CODE_FAIL, 'content' => '您操作太快了,速度越慢越能博到状元,刷新页面再试试');
// }
// $mc->save($key, time());
$this->ci->load->library('bobing/dice');
$this->ci->dice->init();
$size_result = $this->ci->dice->getResultArr();
@@ -95,13 +95,13 @@ class Bo extends Base
$popup = array('title' => '开桌', 'content' => $content, 'btn' => array('title' => '立即开桌', 'url' => '/bobing/pages/game/index'));
return array('status' => 2, 'popup' => $popup);
}
$mc = &load_cache();
$key = 'LiChe_bobing_' . $this->act_key . $this->app_id . $this->uid;
$timeout = $mc->get($key);
if ($timeout && (time() - $timeout) < 2) {
return array('status' => API_CODE_FAIL, 'msg' => '您操作太快了,速度越慢越能博到状元,刷新页面再试试');
}
$mc->save($key, time());
// $mc = &load_cache();
// $key = 'LiChe_bobing_' . $this->act_key . $this->app_id . $this->uid;
// $timeout = $mc->get($key);
// if ($timeout && (time() - $timeout) < 2) {
// return array('status' => API_CODE_FAIL, 'msg' => '您操作太快了,速度越慢越能博到状元,刷新页面再试试');
// }
// $mc->save($key, time());
$this->ci->load->library('bobing/dice');
$this->ci->dice->init();
$size_result = $this->ci->dice->getResultArr();
@@ -195,7 +195,9 @@ class Bo extends Base
$data['type'] == 2 && $up_data["wxqy"] = 1;//加企业微信
$this->ci->bobing_user_model->update($up_data, $map);
$map['bo_date'] = $data['bo_date'];
if ($this->ci->bobing_user_credit_model->cache('get', array($map, 'id'))) {
$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'];
@@ -207,7 +209,9 @@ class Bo extends Base
$map_my = array('act_key' => $data['act_key'], 'app_id' => $data['app_id'], 'uid' => $data['cf_uid']);
$this->ci->bobing_user_model->update(array("credit = credit+{$data['credit']}" => null), $map_my);
$map_my['bo_date'] = $data['bo_date'];
if ($this->ci->bobing_user_credit_model->cache('get', array($map_my, 'id'))) {
$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'];
+11 -11
View File
@@ -95,7 +95,7 @@ class Dice
static public function show_result_msg($resultlevel, &$resultname, &$istop)
{
if ($resultlevel == 0) {
$resultname = "鱼鱼加油 再试一次";
$resultname = "加油 再试一次";
} else if ($resultlevel == Dice::RESULT_YX) {
$resultname .= " 一马当先";
} else if ($resultlevel == Dice::RESULT_EJ) {
@@ -261,17 +261,17 @@ class Dice
{
$level = $level == false ? $this->_resultLevel : $level;
$arr = array(
self::RESULT_ZYCJH => 80, //状元插金花
self::RESULT_LBHONG => 60, //六勃红
self::RESULT_ZYCJH => 110, //状元插金花
self::RESULT_LBHONG => 100, //六勃红
//self::RESULT_BD => 13, //遍地锦
self::RESULT_LBHEI => 50, //六勃黑
self::RESULT_WH => 45, //五红
self::RESULT_WZDYX => 40, //五子带一秀
self::RESULT_WZ => 35, //五子
self::RESULT_ZY => 30, //状元
self::RESULT_DT => 15, //对堂
self::RESULT_SH => 8, //三红
self::RESULT_SJ => 4, //四进
self::RESULT_LBHEI => 90, //六勃黑
self::RESULT_WH => 80, //五红
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_FH => 0, //罚黑