切换导航条
此项目
正在载入...
登录
潘浩文
/
maifuzi
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
潘浩文
6 years ago
提交
0fc4f05682c7c51cc62453e0fd766a2e92f9949a
1 个父辈
9c6e4e3c
1 个管道 的构建
通过
耗费 0 秒
接口
变更
1
构建
1
隐藏空白字符变更
内嵌
并排对比
正在显示
1 个修改的文件
包含
21 行增加
和
8 行删除
api/portal/controller/SignController.php
api/portal/controller/SignController.php
查看文件 @
0fc4f05
...
...
@@ -164,10 +164,7 @@ class SignController extends RestBaseController
$score
=
Db
::
name
(
'config'
)
->
where
(
'id'
,
1
)
->
find
();
if
(
$param
[
'status'
]
==
1
){
//根据星期判断music,image(只有早签到)
$date
=
date
(
"w"
,
time
());
//这个可以获取数字星期比如123,注意0是星期日
$config
=
Db
::
name
(
'sign_image'
)
->
where
(
'date'
,
$date
)
->
find
();
$music
=
json_decode
(
$config
[
'music'
],
true
);
$music
=
$music
[
rand
(
0
,
count
(
$music
,
0
)
-
1
)];
//早签到积分
$score
=
$score
[
'morning_sign_score'
];
$type
=
'morning'
;
...
...
@@ -223,16 +220,32 @@ class SignController extends RestBaseController
//返回
$this
->
success
(
'日打卡提交结果'
,
array
(
'background'
=>
cmf_get_image_preview_url
(
$config
[
'image'
]),
'music'
=>
cmf_get_file_download_url
(
$music
[
'url'
]),
'music_name'
=>
$music
[
'name'
],
'score'
=>
$score
,
'day_sign'
=>
$day_sign
,
));
}
/**
* @title 每日一签页面
* @description 每日一签页面渲染
* @author panhaowen
* @url /portal/Sign/day_sign
* @method POST
* @header name:XX-Token require:1 default: desc:token
*/
public
function
day_sign
()
{
$date
=
date
(
"w"
,
time
());
//这个可以获取数字星期比如123,注意0是星期日
$config
=
Db
::
name
(
'sign_image'
)
->
where
(
'date'
,
$date
)
->
find
();
$music
=
json_decode
(
$config
[
'music'
],
true
);
$music
=
$music
[
rand
(
0
,
count
(
$music
,
0
)
-
1
)];
$this
->
success
(
'渲染数据'
,
array
(
'background'
=>
cmf_get_image_preview_url
(
$config
[
'image'
]),
'music'
=>
cmf_get_file_download_url
(
$music
[
'url'
]),
'music_name'
=>
$music
[
'name'
],
));
}
...
...
请
注册
或
登录
后发表评论