切换导航条
此项目
正在载入...
登录
潘浩文
/
maifuzi
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
潘浩文
6 years ago
提交
c5241655507d05a249afd89249425ad874d7662a
1 个父辈
f3ee6508
1 个管道 的构建
通过
耗费 1 秒
接口
变更
1
构建
1
隐藏空白字符变更
内嵌
并排对比
正在显示
1 个修改的文件
包含
9 行增加
和
7 行删除
api/portal/controller/SignController.php
api/portal/controller/SignController.php
查看文件 @
c524165
...
...
@@ -156,8 +156,6 @@ class SignController extends RestBaseController
public
function
daySignPost
(){
$param
=
$this
->
request
->
param
();
$user
=
Db
::
name
(
'user'
)
->
where
(
'id'
,
$this
->
getUserId
())
->
find
();
$config
=
[];
$music
=
[];
//是否需要进入每日一签页面
$day_sign
=
0
;
//根据签到种类判断增加积分数
...
...
@@ -217,7 +215,6 @@ class SignController extends RestBaseController
Db
::
name
(
'user_score_log'
)
->
insert
([
'score'
=>
$score
,
'create_time'
=>
time
(),
'action'
=>
'打卡'
,
'user_id'
=>
$user
[
'id'
],
'now_score'
=>
$user
[
'score'
]
+
$score
]);
//返回
$this
->
success
(
'日打卡提交结果'
,
array
(
'day_sign'
=>
$day_sign
,
...
...
@@ -253,7 +250,6 @@ class SignController extends RestBaseController
$score
=
$score
[
'sleep_sign_score'
];
}
$date
=
date
(
"w"
,
time
());
//这个可以获取数字星期比如123,注意0是星期日
$config
=
Db
::
name
(
'sign_image'
)
->
where
(
'date'
,
$date
)
->
find
();
$music
=
json_decode
(
$config
[
'music'
],
true
);
...
...
@@ -279,10 +275,16 @@ class SignController extends RestBaseController
public
function
share
()
{
//用户信息
$config
=
Db
::
name
(
'config'
)
->
where
(
'id'
,
1
)
->
find
();
Db
::
name
(
'user'
)
->
where
(
'id'
,
$this
->
getUserId
())
->
setInc
(
'score'
,
$config
[
'share_score'
]);
$user
=
Db
::
name
(
'user'
)
->
where
(
'id'
,
$this
->
getUserId
())
->
find
();
Db
::
name
(
'user_score_log'
)
->
insert
([
'user_id'
=>
$this
->
getUserId
(),
'score'
=>
$config
[
'share_score'
],
'now_score'
=>
$user
[
'score'
]]);
$config
=
Db
::
name
(
'config'
)
->
where
(
'id'
,
1
)
->
find
();
$beginToday
=
mktime
(
0
,
0
,
0
,
date
(
'm'
),
date
(
'd'
),
date
(
'Y'
));
$endToday
=
mktime
(
0
,
0
,
0
,
date
(
'm'
),
date
(
'd'
)
+
1
,
date
(
'Y'
))
-
1
;
$re
=
Db
::
name
(
'user_score_log'
)
->
where
([
'user_id'
=>
$user
[
'id'
],
'action'
=>
'分享'
,
'create_time'
=>
[
'between time'
,
[
$beginToday
,
$endToday
]]])
->
find
();
if
(
$re
){
$this
->
error
(
'您今天已经分享过了'
);
}
Db
::
name
(
'user'
)
->
where
(
'id'
,
$user
[
'id'
])
->
setInc
(
'score'
,
$config
[
'share_score'
]);
Db
::
name
(
'user_score_log'
)
->
insert
([
'user_id'
=>
$user
[
'id'
],
'score'
=>
$config
[
'share_score'
],
'now_score'
=>
(
$user
[
'score'
]
+
$config
[
'share_score'
])]);
$this
->
success
(
'分享成功'
);
}
...
...
请
注册
或
登录
后发表评论