切换导航条
此项目
正在载入...
登录
郭盛
/
store
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
王晓刚
5 years ago
提交
437b32d5a32ca0e39ee23b93fbbf7c0b423fe644
1 个父辈
39edf94f
1 个管道 的构建
通过
耗费 0 秒
修改问题文档
变更
1
构建
1
隐藏空白字符变更
内嵌
并排对比
正在显示
1 个修改的文件
包含
13 行增加
和
9 行删除
application/index/controller/Member.php
application/index/controller/Member.php
查看文件 @
437b32d
...
...
@@ -559,16 +559,20 @@ class Member extends Frontend
$vipdesc_model
= new Vipdesc();
$price
=
$price_model->where
('id',1)->find();
$vipdesc
=
$vipdesc_model->where
('id',1)->find();
//折合svip价格
$user_province
= Db::name('user_province')->where(['user_id'=>
$this->auth
->id,'expiration_time'=>['gt',time()]])->select();
$deduct_price
= [];
$ratio_price
=
$price['vipprice']
/(365);
foreach(
$user_province
as
$key
=>
$u_p
){
$ratio_day
= (
$u_p['expiration_time']
-time())/(24*60*60);
$deduct_price
[] =
$ratio_price
*
$ratio_day
;
$userModel
= new \app\index\model\User();
$user
=
$userModel->findData
(['id'=>
$this->auth
->id]);
if(
$user['svip_passtime']
< time()){
//折合svip价格
$user_province
= Db::name('user_province')->where(['user_id'=>
$this->auth
->id,'expiration_time'=>['gt',time()]])->select();
$deduct_price
= [];
$ratio_price
=
$price['vipprice']
/(365);
foreach(
$user_province
as
$key
=>
$u_p
){
$ratio_day
= (
$u_p['expiration_time']
-time())/(24*60*60);
$deduct_price
[] =
$ratio_price
*
$ratio_day
;
}
$svipprice
= (
$price['svipprice']
-array_sum(
$deduct_price
)) <= 0 ? 0 : (
$price['svipprice']
-array_sum(
$deduct_price
));
$price['svipprice']
= round(
$svipprice
,2);
}
$svipprice
= (
$price['svipprice']
-array_sum(
$deduct_price
)) <= 0 ? 0 : (
$price['svipprice']
-array_sum(
$deduct_price
));
$price['svipprice']
= round(
$svipprice
,2);
$this->assign
('price',
$price
);
$this->view
->assign('price',
$price
);
$this->view
->assign('vipdesc',
$vipdesc
);
...
...
请
注册
或
登录
后发表评论