正在显示
1 个修改的文件
包含
4 行增加
和
2 行删除
@@ -292,8 +292,10 @@ class SignController extends RestBaseController | @@ -292,8 +292,10 @@ class SignController extends RestBaseController | ||
292 | 292 | ||
293 | $date=date("w",time()); //这个可以获取数字星期比如123,注意0是星期日 | 293 | $date=date("w",time()); //这个可以获取数字星期比如123,注意0是星期日 |
294 | $config=Db::name('sign_image')->where('date',$date)->find(); | 294 | $config=Db::name('sign_image')->where('date',$date)->find(); |
295 | - $music=json_decode($config['music'],true); | ||
296 | - $music=$music[rand(0,count($music,0)-1)]; | 295 | + if (!empty($config['music'])) { |
296 | + $music = json_decode($config['music'], true); | ||
297 | + $music = $music[rand(0, count($music, 0) - 1)]; | ||
298 | + } | ||
297 | $this->success('渲染数据',array( | 299 | $this->success('渲染数据',array( |
298 | 'background'=>cmf_get_image_preview_url($config['image']), | 300 | 'background'=>cmf_get_image_preview_url($config['image']), |
299 | 'music'=>cmf_get_file_download_url($music['url']), | 301 | 'music'=>cmf_get_file_download_url($music['url']), |
-
请 注册 或 登录 后发表评论