diff --git a/api/controllers/plan/Bobing.php b/api/controllers/plan/Bobing.php
index c0f4cf29..fb77d3c1 100644
--- a/api/controllers/plan/Bobing.php
+++ b/api/controllers/plan/Bobing.php
@@ -40,12 +40,12 @@ class Bobing extends HD_Controller
echo '[0]点过后才会开奖昨天的中奖用户[' . $hour . ']';
return;
}
- if ($this->appConfig['game_start_date'] > date('Y-m-d')) {
+ if ($this->appConfig['game_start_date'] > date('Y-m-d H:i')) {
echo '博饼未开始';
return;
}
- $date = date('Y-m-d', strtotime('+1 day'));
- if ($this->appConfig['game_end_date'] < $date) {
+ $game_end_date = date('Y-m-d H:i', strtotime('-1 day'));
+ if ($this->appConfig['game_end_date'] < $game_end_date) {
echo '博饼已结束';
return;
}
@@ -77,29 +77,35 @@ class Bobing extends HD_Controller
}
/**
- * Notes:
+ * Notes:马甲跑分数
* Created on: 2021/9/8 11:59
* Created by: dengbw
+ * https://liche-api-dev.xiaoyu.com/plan/bobing/mj
+ * https://api.liche.cn/plan/bobing/mj
*/
public function mj()
{
$hour = date('H');
- if ($hour > 9 && $hour > 22) {
+ if ($hour < 9 || $hour > 22) {
echo '9点到22点博';
return;
}
- if ($this->appConfig['game_start_date'] > date('Y-m-d')) {
+ if ($this->appConfig['game_start_date'] > date('Y-m-d H:i')) {
echo '博饼未开始';
return;
}
- $date = date('Y-m-d', strtotime('+1 day'));
- if ($this->appConfig['game_end_date'] < $date) {
+ if ($this->appConfig['game_end_date'] < date('Y-m-d H:i')) {
echo '博饼已结束';
return;
}
- $uid = 14;
+ $uid = 5;
$credit = rand(50, 120);
- $this->mdBobingUser->update(array('credit' => $credit), array('uid' => $uid,
+ $ret = $this->mdBobingUser->update(array("credit = credit+{$credit}" => null), array('uid' => $uid,
'app_id' => $this->appConfig['app_id'], 'act_key' => $this->appConfig['act_key']));
+ if ($ret) {
+ echo 'uid(' . $uid . ')本次加了' . $credit;
+ } else {
+ echo 'uid(' . $uid . ')本次加分失败了';
+ }
}
}
diff --git a/api/controllers/plan/Plan.php b/api/controllers/plan/Plan.php
index 4d3c7d13..161b2873 100644
--- a/api/controllers/plan/Plan.php
+++ b/api/controllers/plan/Plan.php
@@ -26,8 +26,8 @@ class Plan extends CI_Controller
//执行失败的plan重跑
$plan[] = array('url' => base_url(array('plan', 'plan', 'replan')), 'interval' => 1);
- $plan[] = array('url' => base_url(array('plan', 'bobing', 'lottery')), 'interval' => 30);
-
+ $plan[] = array('url' => base_url(array('plan', 'bobing', 'lottery')), 'interval' => 30);//博饼每日中奖
+ $plan[] = array('url' => base_url(array('plan', 'bobing', 'mj')), 'interval' => 30);//马甲跑分数
$this->plan = $plan;
}
diff --git a/api/controllers/wxapp/bobing/Bobing.php b/api/controllers/wxapp/bobing/Bobing.php
index ff03724e..07c77a06 100644
--- a/api/controllers/wxapp/bobing/Bobing.php
+++ b/api/controllers/wxapp/bobing/Bobing.php
@@ -60,8 +60,8 @@ class Bobing extends Wxapp
// $share_content = array('我已经博取' . $car_gold . '元购车金和' . $credit . '幸运分',
// '运气超越了全闽南' . $percentage . '%的用户。', '快来帮我助力博饼冲击汽车大奖,', '助力博饼可以获得现金奖励,最高100元哦!');
$share_content = array('car_gold' => $car_gold, 'credit' => $credit, 'percentage' => $percentage . '%');
- $content = '
目前累计' . $car_gold . '元购车金和' . $credit . '幸运分,您的运气爆表,
超越了全闽南' . $percentage . '%的用户,
-邀请好友助力博饼,获得更多购车金,冲击汽车大奖~
助力好友可获得现金红包,最高100元!
';
+ $content = '目前累计 ' . $car_gold . ' 元购车金和 ' . $credit . ' 幸运分,
您的运气爆表,超越了全闽南 ' . $percentage . '% 的用户,
+邀请好友助力博饼,获得更多购车金,冲击汽车大奖~
助力好友可获得现金红包,最高 100 元!
';
$share = array('title' => '送你100元现金,帮我博取购车金和汽车大奖', 'share_content' => $share_content, 'content' => $content
, 'img' => $this->mdBobingUser->appImg('share_tip', $this->car_id), 'posters' => $this->mdBobingUser->appImg('posterbg', $this->car_id));
$result['valid_nums'] = $this->get_valid_nums($cf_uid);
@@ -257,7 +257,7 @@ class Bobing extends Wxapp
} else {
$where = array('app_id' => $this->appConfig['app_id'], 'act_key' => $this->appConfig['act_key'], 'uid' => $this->myuid);
}
- $res_l = $this->mdBobingLogs->select($where, 'id DESC', 1, 7, 'credit,hong_bao,car_gold,type,uid,cf_uid');
+ $res_l = $this->mdBobingLogs->select($where, 'id DESC', 1, 10, 'credit,hong_bao,car_gold,type,uid,cf_uid');
if ($res_l) {
$uids = array_column($res_l, 'cf_uid');
array_unique($uids);
diff --git a/api/controllers/wxapp/bobing/Home.php b/api/controllers/wxapp/bobing/Home.php
index 627fc766..07f1332b 100644
--- a/api/controllers/wxapp/bobing/Home.php
+++ b/api/controllers/wxapp/bobing/Home.php
@@ -311,15 +311,15 @@ 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 = '您已添加顾问领取到' . intval($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']);
$re_uc = $this->mdBobingUserCredit->get(array_merge($where, array('uid' => $this->myuid, 'lottery>' => 0)));
if ($re_uc) {
$bo_date = date('n月d日', strtotime($re_uc['bo_date']));
- $tips .= '您在' . $bo_date . '获得单日排行榜前' . $this->appConfig['lottery_nums']
- . '名,
获得购车金' . $this->appConfig['lotter_gold'] . '元购车金可叠加使用
';
+ $tips .= '☛ 您在' . $bo_date . '获得单日排行榜前' . $this->appConfig['lottery_nums']
+ . '名,
获得购车金' . $this->appConfig['lotter_gold'] . '元,购车金可叠加使用
';
} else {
$sum = $this->mdBobingUser->count($where);
$row = $this->mdBobingUser->count(array_merge($where, array('credit<=' => $credit)));
@@ -329,7 +329,6 @@ class Home extends Wxapp
$tips .= '继续邀请好友助力博饼,冲刺大奖吧~
';
}
}
- //$menulist[] = array('title' => '9.9抢500购车金', 'url' => 'buy_car_gold', 'img' => $this->mdBobingUser->appImg('icon-mine-1'));
$menulist[] = array('title' => '预约试驾', 'url' => '/bobing/pages/game/signUp/index', 'img' => $this->mdBobingUser->appImg('icon-mine-4'));
$menulist[] = array('title' => '我的海报', 'url' => '/bobing/pages/game/invite/index', 'img' => $this->mdBobingUser->appImg('icon-mine-2'));
$menulist[] = array('title' => '联系客服', 'url' => '/pages/', 'img' => $this->mdBobingUser->appImg('icon-mine-3'));
@@ -354,10 +353,20 @@ class Home extends Wxapp
protected function get_img()
{
$params = $this->input->get();
- if (!$params['name']) {
+ $name = $params['name'];
+ if (!$name) {
throw new Hd_Exception('图片名称必填', API_CODE_INVILD_PARAM);
}
- $this->data['img'] = $this->mdBobingUser->appImg($params['name'], $this->car_id);
+ $urls = array();
+ if (strstr($name, ',')) {
+ $names = explode(',', $name);
+ foreach ($names as $key => $value) {
+ $urls[] = $this->mdBobingUser->appImg($value, $this->car_id);
+ }
+ } else {
+ $urls = $this->mdBobingUser->appImg($name, $this->car_id);
+ }
+ $this->data['img'] = $urls ? $urls : '';
return $this->data;
}
diff --git a/common/models/bobing/Bobing_user_model.php b/common/models/bobing/Bobing_user_model.php
index 896ee910..b6b8de0f 100644
--- a/common/models/bobing/Bobing_user_model.php
+++ b/common/models/bobing/Bobing_user_model.php
@@ -34,39 +34,39 @@ class Bobing_user_model extends Base_model
$config = array();
if ($act_key == 2021) {
$config = array(
- 'title' => 'LiChe博饼', 'content' => '2021闽南博饼嘉年华', 'game_start_date' => '2021-09-01 10:00', 'game_end_date' => '2021-10-08 15:00',
+ 'title' => 'LiChe博饼', 'content' => '2021闽南博饼嘉年华', 'game_start_date' => '2021-09-08 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' => 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次博饼机会,博饼机会用完后,可通过邀请好友助力博饼(每位好友最多可助力5次),参与用户可获得如下奖励:
-(1)开桌用户
- ① 获得购车金: 每次博饼,有几率获得随机金额的购车金。好友助力博饼,有几率帮其获得随机金额的购车金,购车金可以累加使用;
- ② 获得幸运分: 每次助力博饼,根据博出的结果,可获得相应的幸运分:一秀5分、二举10分、四进15分、三红20分、对堂30分、状元50分、
+
(1)开桌用户
+
① 获得购车金: 每次博饼,有几率获得随机金额的购车金。好友助力博饼,有几率帮其获得随机金额的购车金,本人获得的购车金可以无限叠加使用;
+
② 获得幸运分: 每次助力博饼,根据博出的结果,可获得相应的幸运分:一秀5分、二举10分、四进15分、三红20分、对堂30分、状元50分、
五子60分、五子带一秀70分、五红80分、六勃黑90分、六勃红100分、状元插金花120分;
-
(2)助力用户
-
① 获得现金红包:每次助力博饼,随机掉落现金红包,打开后有几率获得最高100元现金,现金直接转入获奖用户的微信钱包;
-
② 获得幸运分: 每次助力博饼,根据博出的结果,可同时为自己获得相应的幸运分:一秀5分、二举10分、四进15分、三红20分、对堂30分、状元50分、
+
(2)助力用户
+
① 获得现金红包:每次助力博饼,随机掉落现金红包,最高100元现金,现金直接转入获奖用户的微信钱包;
+
② 获得幸运分: 每次助力博饼,根据博出的结果,可同时为自己获得相应的幸运分:一秀5分、二举10分、四进15分、三红20分、对堂30分、状元50分、
五子60分、五子带一秀70分、五红80分、六勃黑90分、六勃红100分、状元插金花120分;
-
2. 所有用户均可通过添加狸车顾问微信,直接领取500元购车金(购车金可以与博饼获得的购车金共同累计,一位用户活动期间只能领取一次)。
-
3. 每日博饼幸运分进入日排行榜,前五名可额外获得1000元购车金(购车金可以与博饼获得的购车金共同累计,一位用户活动期间只能获得一次日排行奖励)
-
4. 活动期间博饼幸运分进入总排行榜,第一名获得新能源汽车大奖(车辆所有权、个人偶然所得税自理)
-
5. 每日排行、总排行榜若出现幸运分相同的情况,则以用户首次进行博饼的时间进行排序依据,越早参加博饼的用户,排名越靠前;
-
6. 关于购车金
+
2. 所有用户均可通过添加狸车顾问微信,直接领取500元购车金(购车金可以与博饼获得的购车金共同累计,一位用户活动期间只能领取一次)。
+
3. 每日博饼幸运分进入日排行榜,前五名可额外获得1000元购车金(购车金可以与博饼获得的购车金共同累计,一位用户活动期间只能获得一次日排行奖励)
+
4. 活动期间博饼幸运分进入总排行榜,第一名获得新能源汽车大奖(车辆所有权、个人偶然所得税自理)
+
5. 每日排行、总排行榜若出现幸运分相同的情况,则以用户首次进行博饼的时间进行排序依据,越早参加博饼的用户,排名越靠前;
+
6. 关于购车金
(1)活动期间用户博取的购车金、领取的购车金以及排名奖励的购车金均可累计使用;
(2)使用范围为:泉州、漳州、厦门指定的经销商
(3)使用的品牌车型为:
-
川汽野马-雷丁芒果
-
东风新能源-EX1
-
哪吒-哪吒V
-
零跑-零跑T03、S01、C11
-
欧拉-黑猫、白猫、好猫
-
奇瑞新能源-小蚂蚁
-
(4)使用购车金时,用户可在经销商处协商好购车价后,再提出购车金抵扣,不影响正常车辆优惠政策;
-
6. 任何问题均可联系新能源汽车顾问解答。
-
7. 在法律允许范围内,主办方拥有对本次活动的最终解释权。
'),
+
川汽野马-雷丁芒果
+
东风新能源-EX1
+
哪吒-哪吒V
+
零跑-零跑T03、S01、C11
+
欧拉-黑猫、白猫、好猫
+
奇瑞新能源-小蚂蚁
+
(4)使用购车金时,用户可在经销商处协商好购车价后,再提出购车金抵扣,不影响正常车辆优惠政策;
+
6. 任何问题均可联系新能源汽车顾问解答。
+
7. 在法律允许范围内,主办方拥有对本次活动的最终解释权。
'),
);
}
return $config;
@@ -91,7 +91,7 @@ class Bobing_user_model extends Base_model
if ($id == 15) {//15ex1 13雷丁
$url_id .= 'ex1-';
}
- $v = '?0908';
+ $v = '?0909';
$imgs['banner'] = $url_id . 'banner.jpg' . $v;
//公用头图
$imgs['banner2'] = $url_id . 'banner2.png' . $v;
@@ -102,6 +102,7 @@ class Bobing_user_model extends Base_model
//分享图
$imgs['share_tip'] = $url_id . 'share-tip.jpg' . $v;
$imgs['signUp-theme'] = $url_id . 'signUp-theme.jpg' . $v;
+ $imgs['kefucode'] = $url_id . 'kefucode.jpg' . $v;
//礼品
$imgs['gift'] = array(
array('id' => 1, 'title' => '第一名', 'img' => $url_id . 'gift_box_tip_1.jpg' . $v),
diff --git a/home/controllers/h5/Hongbao.php b/home/controllers/h5/Hongbao.php
index c6116496..9916cc5e 100644
--- a/home/controllers/h5/Hongbao.php
+++ b/home/controllers/h5/Hongbao.php
@@ -25,9 +25,7 @@ class Hongbao extends CI_Controller
// $params['id'] = 828932;
$data = array('code' => 400, 'title' => '领取成功', 'msg' => '恭喜您领到了一年的好运气');
$msg = '';
- if (!$params['id'] || !$params['uid']) {
- $msg = '参数错误!';
- } else {
+ if ($params['id'] && $params['uid']) {
$this->uid = intval($params['uid']);
$id = intval($params['id']);
$re_l = $this->mdBobingLogs->get(array('id' => $id));
@@ -63,7 +61,7 @@ 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'] = '转帐失败!';
}
diff --git a/home/views/h5/hongbao/index.php b/home/views/h5/hongbao/index.php
index 5f3ab444..fb46b208 100644
--- a/home/views/h5/hongbao/index.php
+++ b/home/views/h5/hongbao/index.php
@@ -8,37 +8,35 @@
领取红包
-
+
if ($code == 200) { ?>
-
+
} else { ?>
-
+
} ?>
-
-
-
- = $title ?>
-
-
= $msg ?>
-
-
+
-