正在显示
1 个修改的文件
包含
11 行增加
和
0 行删除
@@ -592,6 +592,17 @@ class Member extends Frontend | @@ -592,6 +592,17 @@ class Member extends Frontend | ||
592 | } | 592 | } |
593 | $price_model = new Price(); | 593 | $price_model = new Price(); |
594 | $price = $price_model->where('id',1)->find(); | 594 | $price = $price_model->where('id',1)->find(); |
595 | + //折合svip价格 | ||
596 | + $user_province = Db::name('user_province')->where(['user_id'=>$this->auth->id,'expiration_time'=>['gt',time()]])->select(); | ||
597 | + $deduct_price = []; | ||
598 | + $ratio_price = $price['vipprice']/(365); | ||
599 | + foreach($user_province as $key => $u_p){ | ||
600 | + $ratio_day = ($u_p['expiration_time']-time())/(24*60*60); | ||
601 | + $deduct_price[] = $ratio_price*$ratio_day; | ||
602 | + } | ||
603 | + $svipprice = ($price['svipprice']-array_sum($deduct_price)) <= 0 ? 0 : ($price['svipprice']-array_sum($deduct_price)); | ||
604 | + $price['svipprice'] = round($svipprice,2); | ||
605 | + $this->assign('price',$price); | ||
595 | $price['price'] = $price['svipprice']; | 606 | $price['price'] = $price['svipprice']; |
596 | if($store_type == 1) { | 607 | if($store_type == 1) { |
597 | $select_data = [ | 608 | $select_data = [ |
-
请 注册 或 登录 后发表评论