切换导航条
此项目
正在载入...
登录
潘浩文
/
scoreshop
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
潘浩文
6 years ago
提交
479287cf0d14c4194383bb77cdfb0816455e7fd6
1 个父辈
d6005517
1 个管道 的构建
通过
耗费 0 秒
1
变更
2
构建
1
隐藏空白字符变更
内嵌
并排对比
正在显示
2 个修改的文件
包含
6 行增加
和
2 行删除
app/portal/controller/AdminPrizeOrderController.php
app/portal/controller/PrizeController.php
app/portal/controller/AdminPrizeOrderController.php
查看文件 @
479287c
...
...
@@ -34,7 +34,7 @@ class AdminPrizeOrderController extends AdminBaseController
->
join
(
'prize p'
,
'po.prize_id=p.id'
)
->
join
(
'users u'
,
'po.users_id=u.id'
)
->
where
(
$where
)
->
field
(
'po.*,
u.*,p.name,p.score as pscore,po.status as postatus
'
)
->
field
(
'po.*,
p.name,p.score as pscore,po.status as postatus,u.nickname,u.mobile
'
)
->
paginate
(
'15'
);
$data
->
appends
(
$param
);
...
...
app/portal/controller/PrizeController.php
查看文件 @
479287c
...
...
@@ -126,12 +126,16 @@ class PrizeController extends WeChatBaseController
public
function
getPrize
(){
$re
=
$this
->
checkUser
();
$id
=
$this
->
request
->
param
(
'id'
);
if
(
Db
::
name
(
'users'
)
->
where
(
'id'
,
$re
[
'id'
])
->
find
()[
'score'
]
<
Db
::
name
(
'prize'
)
->
where
(
'id'
,
$id
)
->
find
()[
'score'
]){
$users_score
=
Db
::
name
(
'users'
)
->
where
(
'id'
,
$re
[
'id'
])
->
find
()[
'score'
];
$prize_score
=
Db
::
name
(
'prize'
)
->
where
(
'id'
,
$id
)
->
find
()[
'score'
];
if
(
$users_score
<
$prize_score
){
return
0
;
}
$data
[
'prize_id'
]
=
$id
;
$data
[
'users_id'
]
=
$re
[
'id'
];
$data
[
'create_time'
]
=
time
();
Db
::
name
(
'users'
)
->
where
(
'id'
,
$re
[
'id'
])
->
setDec
(
'score'
,
$prize_score
);
Db
::
name
(
'users_score_log'
)
->
insert
([
'users_id'
=>
$re
[
'id'
],
'create_time'
=>
time
(),
'action'
=>
'兑换礼品'
,
'score'
=>
$prize_score
]);
Db
::
name
(
'prize_order'
)
->
insert
(
$data
);
return
1
;
}
...
...
请
注册
或
登录
后发表评论