config.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. /**
  3. * 更新
  4. */
  5. defined('InShopNC') or exit('Access Invalid!');
  6. require_once(BASE_ROOT_PATH . '/helper/ugc_helper.php');
  7. class configControl extends mobileHomeControl
  8. {
  9. public function __construct()
  10. {
  11. parent::__construct();
  12. }
  13. public function getconfigexOp()
  14. {
  15. $result['app_config'] = ['sale_mobile' => '021-64260858',
  16. 'index_tip' => '登录后会显示您的专属红包价',
  17. 'login_tip' => '提示: 领到红包用户,可直接用微信登录',
  18. 'cancel_order_tip' => '取消订单后只退还红包,不退F码,确定要取消订单吗?',
  19. 'refund_money_tip' => '申请退款后红包与F码均不会退还,确定要申请退款吗?',
  20. 'cart_unlogin_tip' => '登录后,才能显示总价',
  21. 'ugc_categories' => ugc_helper::categories()];
  22. return self::outsuccess($result);
  23. }
  24. /**
  25. * 获取配置文件
  26. * 参数: platform 1:android 2:ios
  27. */
  28. public function getconfigOp()
  29. {
  30. $platform = trim($_GET['platform']);
  31. $ver_code = trim($_GET['ver_code']);
  32. if (!isset($platform) || empty($platform)) {
  33. return self::outerr(errcode::ErrInputParam);
  34. }
  35. if (!isset($ver_code) || empty($ver_code)) {
  36. return self::outerr(errcode::ErrInputParam);
  37. }
  38. $result = Model()->table('config')->select();
  39. if (empty($result)) {
  40. return self::outerr(errcode::ErrGetConfig);
  41. }
  42. else
  43. {
  44. $ret = array();
  45. foreach ($result as $value) {
  46. $ret[$value['name']] = array('value'=>$value['value']);
  47. }
  48. $ret['feed_back_url'] = array('value'=> BASE_SITE_URL . '/mobile/index.php?act=member_feedback&op=add&client_type=ios');
  49. }
  50. return self::outsuccess($ret);
  51. }
  52. }