正在显示
1 个修改的文件
包含
21 行增加
和
8 行删除
@@ -164,10 +164,7 @@ class SignController extends RestBaseController | @@ -164,10 +164,7 @@ class SignController extends RestBaseController | ||
164 | $score=Db::name('config')->where('id',1)->find(); | 164 | $score=Db::name('config')->where('id',1)->find(); |
165 | if ($param['status']==1){ | 165 | if ($param['status']==1){ |
166 | //根据星期判断music,image(只有早签到) | 166 | //根据星期判断music,image(只有早签到) |
167 | - $date=date("w",time()); //这个可以获取数字星期比如123,注意0是星期日 | ||
168 | - $config=Db::name('sign_image')->where('date',$date)->find(); | ||
169 | - $music=json_decode($config['music'],true); | ||
170 | - $music=$music[rand(0,count($music,0)-1)]; | 167 | + |
171 | //早签到积分 | 168 | //早签到积分 |
172 | $score=$score['morning_sign_score']; | 169 | $score=$score['morning_sign_score']; |
173 | $type='morning'; | 170 | $type='morning'; |
@@ -223,16 +220,32 @@ class SignController extends RestBaseController | @@ -223,16 +220,32 @@ class SignController extends RestBaseController | ||
223 | 220 | ||
224 | //返回 | 221 | //返回 |
225 | $this->success('日打卡提交结果',array( | 222 | $this->success('日打卡提交结果',array( |
226 | - 'background'=>cmf_get_image_preview_url($config['image']), | ||
227 | - 'music'=>cmf_get_file_download_url($music['url']), | ||
228 | - 'music_name'=>$music['name'], | ||
229 | 'score'=>$score, | 223 | 'score'=>$score, |
230 | 'day_sign'=>$day_sign, | 224 | 'day_sign'=>$day_sign, |
231 | )); | 225 | )); |
232 | } | 226 | } |
233 | 227 | ||
234 | 228 | ||
235 | - | 229 | + /** |
230 | + * @title 每日一签页面 | ||
231 | + * @description 每日一签页面渲染 | ||
232 | + * @author panhaowen | ||
233 | + * @url /portal/Sign/day_sign | ||
234 | + * @method POST | ||
235 | + * @header name:XX-Token require:1 default: desc:token | ||
236 | + */ | ||
237 | + public function day_sign() | ||
238 | + { | ||
239 | + $date=date("w",time()); //这个可以获取数字星期比如123,注意0是星期日 | ||
240 | + $config=Db::name('sign_image')->where('date',$date)->find(); | ||
241 | + $music=json_decode($config['music'],true); | ||
242 | + $music=$music[rand(0,count($music,0)-1)]; | ||
243 | + $this->success('渲染数据',array( | ||
244 | + 'background'=>cmf_get_image_preview_url($config['image']), | ||
245 | + 'music'=>cmf_get_file_download_url($music['url']), | ||
246 | + 'music_name'=>$music['name'], | ||
247 | + )); | ||
248 | + } | ||
236 | 249 | ||
237 | 250 | ||
238 | 251 |
-
请 注册 或 登录 后发表评论