Manage.php 798 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. namespace Shop\Lib;
  3. use Dever;
  4. class Manage
  5. {
  6. /**
  7. * 更新信息
  8. *
  9. * @return mixed
  10. */
  11. public function infoUpdate($id, $name, $data)
  12. {
  13. $update = array();
  14. $area = Dever::param('area', $data);
  15. if ($area) {
  16. $temp = is_string($area) ? explode(',', $area) : $area;
  17. $update['province'] = $temp[0];
  18. $update['city'] = $temp[1];
  19. }
  20. $map = Dever::param('map', $data);
  21. if ($map) {
  22. $temp = is_string($map) ? explode(',', $map) : $map;
  23. $update['lng'] = $temp[1];
  24. $update['lat'] = $temp[2];
  25. }
  26. if (isset($update) && $update) {
  27. $update['where_id'] = $id;
  28. Dever::db('shop/info')->update($update);
  29. }
  30. }
  31. }