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

接口

... ... @@ -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'],
));
}
... ...