Commit e0635347 by 冷斌

推广

parent a9c61691
......@@ -184,7 +184,7 @@ class ZyRechargeModel extends Model
$recharge = M('zy_recharge')->where(array('pay_pass_num' => $pay_pass_num))->find();
//推广奖励
if ($recharge['invite_id'] > 0) {
$count = M('zy_recharge')->where(array('invite_id' => $recharge['invite_id']))->count();
$count = M('zy_recharge')->where(array('invite_id' => $recharge['invite_id'], 'status' => 1))->count();
$num = $count - 1;
$level = [
0 => 0.1,
......@@ -224,9 +224,9 @@ class ZyRechargeModel extends Model
if ($attach) {
$data['note_wxpay'] = $attach;
}
$this->share($pay_pass_num);
//修改购买记录状态
if (false !== M('zy_recharge')->where(array('pay_pass_num' => $pay_pass_num))->save($data)) {
$this->share($pay_pass_num);
return true;
} else {
return false;
......
......@@ -439,12 +439,26 @@ class HomeAction extends UserAction
// $this->assign('data', $video_share);
// $data['data'] = $this->fetch('share_list');
$num = M('zy_recharge')->where(array('invite_id' => $this->mid, 'status' => 1))->count();
$level = [
0 => 0.1,
50 => 0.2,
180 => 0.3
];
$r = 0;
foreach ($level as $time => $rate) {
if ($num >= $time) {
$r = $rate;
}
}
$title = ['普通推广员', '高级推广员', ''];
$balancee = M('zy_split_balance')->where([
'uid' => $this->mid
])->getField('balance');
$this->assign('balance', $balancee);
$this->assign('title', $title[$r]);
$this->display();
exit;
}
......
......@@ -7,7 +7,7 @@
<div id="app">
<div class="layout_v">
<div class="promotion_top_hint text_12_400 color_999999">当前身份:普通推广员</div>
<div class="promotion_top_hint text_12_400 color_999999">当前身份:{$title}</div>
<div class="promotion_input_container layout_h_v_c">
<div class="layout_v_b">
<span class="text_14_400 color_333333">收益金额</span>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment