CommonController.class.php 978 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace Home\Controller;
  3. use Think\Controller;
  4. class CommonController extends BaseController {
  5. //保存
  6. public function qrcode(){
  7. Vendor('Phpqrcode.phpqrcode');
  8. $url = I("url");
  9. $url = urldecode($url) ? urldecode($url) : $url;
  10. $size = I("size") ? I("size") : 6;
  11. $object = new \QRcode();
  12. $object->png($url, false, 3 , $size, 2);
  13. }
  14. public function checkForUpdate(){
  15. $option_data = D("Options")->where("option_name='version' ")->find();
  16. $post_data = array(
  17. "version" => $option_data['option_value'] ,
  18. );
  19. $version = $option_data['option_value'];
  20. // TODO 此功能是留着检测更新用的。未完成。代码有空再写吧
  21. //$url = "http://api.pkbigdata.com/";
  22. //$result = http_post($url , $post_data);
  23. //$version_num = str_replace("v", '', $num);
  24. //$result = version_compare($version_num, "2.1.5",'<');
  25. //echo $result;
  26. }
  27. }