bobing_903_3

This commit is contained in:
dengbw
2021-09-03 15:55:58 +08:00
parent 15562067aa
commit c1689e8233
+22 -19
View File
@@ -43,9 +43,10 @@ class Home extends Wxapp
$bo_nums = 0;//$this->mdBobingUser->boNums($this->appConfig['act_key'])
$this->data['bodata'] = array('title' => "累计博饼次数", 'content' => $this->appConfig['content'], 'bo_nums' => $bo_nums);
$lucky_car[] = array('title' => '', 'img' => $this->mdBobingUser->appImg('index-tip'), 'url' => '/pages/buyCar/detail/index?id=' . $this->car_id);
$share = array('title' => '送你100元现金,帮我博取iPhone13、汽车大奖', 'img' => $this->mdBobingUser->appImg('share_tip', $this->car_id));
$this->data['lucky_car'] = $lucky_car;
$this->data['group'] = $this->appConfig['group'];
$this->data['title'] = $this->appConfig['title'];
$this->data['share'] = $share;
return $this->data;
}
@@ -308,27 +309,29 @@ class Home extends Wxapp
if ($re_u) {
$credit = $re_u['credit'];
$car_gold = $re_u['car_gold'] + $re_u['buy_car_gold'];
$where = array('app_id' => $this->appConfig['app_id'], 'act_key' => $this->appConfig['act_key']);
$re_u = $this->mdBobingUserCredit->select(array_merge($where, array('uid' => $this->myuid, 'lottery>' => 0)), 'lottery DESC', 0, 0, 'lottery');
if ($re_u) {
$tipsAry = array();
foreach ($re_u as $key => $value) {
if ($value['lottery'] == 1) {
$tipsAry[] = '购物卡1张';
} else if ($value['lottery'] == 2) {
$tipsAry[] = 'iPhone13手机一只';
} else if ($value['lottery'] == 3) {
$tipsAry[] = '新能源汽车一台';
if ($credit) {
$where = array('app_id' => $this->appConfig['app_id'], 'act_key' => $this->appConfig['act_key']);
$re_u = $this->mdBobingUserCredit->select(array_merge($where, array('uid' => $this->myuid, 'lottery>' => 0)), 'lottery DESC', 0, 0, 'lottery');
if ($re_u) {
$tipsAry = array();
foreach ($re_u as $key => $value) {
if ($value['lottery'] == 1) {
$tipsAry[] = '购物卡1张';
} else if ($value['lottery'] == 2) {
$tipsAry[] = 'iPhone13手机一只';
} else if ($value['lottery'] == 3) {
$tipsAry[] = '新能源汽车一台';
}
}
$tips = '<div><span style="color:#dd4223;">您已中奖' . implode('', $tipsAry) . '</span></div>';
} else {
$sum = $this->mdBobingUser->count($where);
$row = $this->mdBobingUser->count(array_merge($where, array('credit<=' => $credit)));
$percentage = round($row / $sum * 100, 2);
$tips = '<div>您已打败全闽南<span style="color:#dd4223;">' . $percentage . '</span>的用户</div>';
}
$tips = '<div><span style="color:#dd4223;">您已中奖' . implode('', $tipsAry) . '</span></div>';
} else {
$sum = $this->mdBobingUser->count($where);
$row = $this->mdBobingUser->count(array_merge($where, array('credit<=' => $credit)));
$percentage = round($row / $sum * 100, 2);
$tips = '<div>您已打败全闽南<span style="color:#dd4223;">' . $percentage . '</span>的用户</div>';
$tips = $tips . '<div>继续邀请好友助力博饼,冲刺大奖吧~</div>';
}
$tips = $tips . '<div>继续邀请好友助力博饼,冲刺大奖吧~</div>';
}
$menulist[] = array('title' => '9.9抢500购车金', 'url' => 'buy_car_gold', 'img' => $this->mdBobingUser->appImg('icon-mine-1'));
$menulist[] = array('title' => '预约试驾', 'url' => '/pages/buyCar/detail/index?id=' . $this->car_id, 'img' => $this->mdBobingUser->appImg('icon-mine-4'));