Manage.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. namespace Source\Lib;
  3. use Dever;
  4. class Manage
  5. {
  6. /**
  7. * 显示信息
  8. *
  9. * @return mixed
  10. */
  11. public function show($id)
  12. {
  13. $info = Dever::db('source/info')->one($id);
  14. $link = Dever::db('source/link')->one($id);
  15. return '';
  16. }
  17. public function updateCode($id, $name, $param)
  18. {
  19. $cate_id = Dever::param('cate_id', $param);
  20. $type = Dever::param('type', $param);
  21. $link_id = Dever::param('link_id', $param);
  22. $link = Dever::db('source/link')->one($link_id);
  23. if (!$link) {
  24. $link['link'] = Dever::url('home', 'service');
  25. }
  26. $send['cate'] = $cate_id;
  27. $send['source'] = $id;
  28. $send['type'] = $type;
  29. $send['seller'] = 1;
  30. $key = Dever::load('service/base')->key;
  31. $param = array();
  32. $param['p'] = Dever::encode(Dever::json_encode($send), $key);
  33. $param = http_build_query($param);
  34. if (strstr($link['link'], '?')) {
  35. $url = $link['link'] . '&' . $param;
  36. } else {
  37. $url = $link['link'] . '?' . $param;
  38. }
  39. Dever::db('source/info')->update(array('where_id' => $id, 'code' => $url));
  40. }
  41. }