...
|
...
|
@@ -544,15 +544,11 @@ class Member extends Frontend |
|
|
$user_province = Db::name('user_province')->where(['user_id'=>$this->auth->id,'expiration_time'=>['gt',time()]])->select();
|
|
|
$deduct_price = [];
|
|
|
$ratio_price = $price['vipprice']/(365);
|
|
|
dump($ratio_price);
|
|
|
foreach($user_province as $key => $u_p){
|
|
|
$ratio_day = ($u_p['expiration_time']-time())/(24*60*60);
|
|
|
dump($ratio_day);
|
|
|
$deduct_price[] = $ratio_price*$ratio_day;
|
|
|
}
|
|
|
dump($price['svipprice']);
|
|
|
dump($deduct_price);
|
|
|
$svipprice = $price['svipprice']-array_sum($deduct_price);
|
|
|
$svipprice = ($price['svipprice']-array_sum($deduct_price)) <= 0 ? 0 : ($price['svipprice']-array_sum($deduct_price));
|
|
|
$price['svipprice'] = round($svipprice,2);
|
|
|
$this->assign('price',$price);
|
|
|
return $this->view->fetch();
|
...
|
...
|
|