Data.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. namespace Main\Src;
  3. use Dever;
  4. class Data
  5. {
  6. private function applet()
  7. {
  8. $host = Dever::config('base')->applet_content;
  9. if ($host) {
  10. $host .= 'data.applet';
  11. $uphost .= 'data.applet_wechat';
  12. $data = Dever::curl($host);
  13. if ($data) {
  14. foreach ($data as $k => $v) {
  15. $update = array();
  16. $update['appid'] = $v['appid'];
  17. $update['name'] = $v['name'];
  18. $update['secret'] = $v['secret'];
  19. $update['type'] = 3;
  20. $where = array();
  21. $where['option_appid'] = $v['appid'];
  22. $where['option_type'] = $update['type'];
  23. $id = Dever::upinto('main/project', $where, $update);
  24. if ($id > 0) {
  25. Dever::curl($uphost, array('id' => $v['id'], 'wechat_project_id' => $id));
  26. }
  27. }
  28. }
  29. }
  30. }
  31. }