ConfigController.class.php 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. <?php
  2. /**
  3. * lionfish 商城系统
  4. *
  5. * ==========================================================================
  6. * @link http://www.liofis.com/
  7. * @copyright Copyright (c) 2015 liofis.com.
  8. * @license http://www.liofis.com/license.html License
  9. * ==========================================================================
  10. *
  11. * @author fish
  12. *
  13. */
  14. namespace Seller\Controller;
  15. class ConfigController extends CommonController{
  16. protected function _initialize(){
  17. parent::_initialize();
  18. //'pinjie' => '拼团介绍',
  19. }
  20. public function index()
  21. {
  22. if (IS_POST) {
  23. $data = I('request.parameter');
  24. $data['shoname'] = trim($data['shoname']);
  25. $data['shoplogo'] = save_media($data['shoplogo']);
  26. $data['shop_summary'] = trim($data['shop_summary']);
  27. $data['shop_index_share_title'] = trim($data['shop_index_share_title']);
  28. $data['open_diy_index_page'] = intval($data['open_diy_index_page']);
  29. $data['index_list_theme_type'] = intval($data['index_list_theme_type']);
  30. $data['shop_index_share_image'] = save_media($data['shop_index_share_image']);
  31. $data['group_name'] = trim($data['group_name']);
  32. $data['owner_name'] = trim($data['owner_name']);
  33. $data['index_share_switch'] = intval($data['index_share_switch']);
  34. $data['index_change_cate_btn'] = intval($data['index_change_cate_btn']);
  35. $data['index_top_img_bg_open'] = intval($data['index_top_img_bg_open']);
  36. $data['index_top_font_color'] = trim($data['index_top_font_color']);
  37. $data['index_service_switch'] = intval($data['index_service_switch']);
  38. $data['index_switch_search'] = intval($data['index_switch_search']);
  39. $data['hide_community_change_btn'] = intval($data['hide_community_change_btn']);
  40. $data['hide_index_top_communityinfo'] = intval($data['hide_index_top_communityinfo']);
  41. $data['index_type_first_name'] = $data['index_type_first_name'];
  42. $data['ishow_index_copy_text'] = intval($data['ishow_index_copy_text']);
  43. $data['ishow_special_share_btn'] = intval($data['ishow_special_share_btn']);
  44. D('Seller/Config')->update($data);
  45. show_json(1, array('url' => $_SERVER['HTTP_REFERER']));
  46. }
  47. $data = D('Seller/Config')->get_all_config();
  48. $this->data = $data;
  49. $this->display();
  50. }
  51. public function links()
  52. {
  53. $this->display();
  54. }
  55. public function clearqrcode()
  56. {
  57. M('lionfish_comshop_member')->where( "1>0" )->save( array('hexiao_qrcod' => '') );
  58. show_json(1, array('url' => $_SERVER['HTTP_REFERER'] ));
  59. }
  60. /**
  61. * 图片设置
  62. */
  63. public function picture()
  64. {
  65. if (IS_POST) {
  66. $data = I('request.parameter');
  67. $data['admin_login_image'] = save_media($data['admin_login_image']);
  68. $data['seller_backimage'] = save_media($data['seller_backimage']);
  69. $data['saleout'] = save_media($data['saleout']);
  70. $data['loading'] = save_media($data['loading']);
  71. $data['kanjia_index_image'] = trim($data['shop_index_share_title']);
  72. $data['pintuan_index_image'] = save_media($data['pintuan_index_image']);
  73. $data['index_list_top_image'] = save_media($data['index_list_top_image']);
  74. $data['new_group_index_image'] = save_media($data['new_group_index_image']);
  75. $data['fenxiao_apply_index_image'] = save_media($data['fenxiao_apply_index_image']);
  76. $data['goods_details_middle_image'] = save_media($data['goods_details_middle_image']);
  77. $data['index_lead_image'] = save_media($data['index_lead_image']);
  78. $data['auth_bg_image'] = save_media($data['auth_bg_image']);
  79. $data['common_header_backgroundimage'] = save_media($data['common_header_backgroundimage']);
  80. $data['index_header_backgroundimage'] = save_media($data['index_header_backgroundimage']);
  81. $data['user_header_backgroundimage'] = save_media($data['user_header_backgroundimage']);
  82. $datas = D('Seller/Config')->get_all_config();
  83. $data['index_share_qrcode_bg'] = save_media($data['index_share_qrcode_bg']);
  84. if( $datas['index_share_qrcode_bg'] != $data['index_share_qrcode_bg'] )
  85. {
  86. //清理二维码 community_config_qrcode_40 uniacid
  87. M('lionfish_comshop_config')->where( " name like 'community_config_qrcode_%' " )->delete();
  88. }
  89. $data['is_show_index_lead_image'] = $data['is_show_index_lead_image'];
  90. $data['index_list_top_image_on'] = $data['index_list_top_image_on'];
  91. D('Seller/Config')->update($data);
  92. show_json(1, array('url' => $_SERVER['HTTP_REFERER']));
  93. }
  94. $data = D('Seller/Config')->get_all_config();
  95. $this->data = $data;
  96. $this->display('Config/picture');
  97. }
  98. }
  99. ?>