作者 潘浩文
1 个管道 的构建 通过 耗费 0 秒

接口

... ... @@ -220,7 +220,6 @@ class SignController extends RestBaseController
//返回
$this->success('日打卡提交结果',array(
'score'=>$score,
'day_sign'=>$day_sign,
));
}
... ... @@ -236,9 +235,24 @@ class SignController extends RestBaseController
* @return background:背景图片
* @return music:背景音乐
* @return music_name:背景音乐名称
* @return score:签到积分
*/
public function day_sign()
{
$param=$this->request->param();
$score=Db::name('config')->where('id',1)->find();
if ($param['status']==1){
//早签到积分
$score=$score['morning_sign_score'];
}elseif ($param['status']==2){
$score=$score['noon_sign_score'];
}elseif ($param['status']==3){
$score=$score['night_sign_score'];
}elseif ($param['status']==4){
$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);
... ... @@ -247,6 +261,7 @@ class SignController extends RestBaseController
'background'=>cmf_get_image_preview_url($config['image']),
'music'=>cmf_get_file_download_url($music['url']),
'music_name'=>$music['name'],
'score'=>$score,
));
}
... ...