BaseStoreSns.php 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <?php
  2. namespace app\home\controller;
  3. use think\facade\View;
  4. use think\facade\Lang;
  5. /**
  6. * ============================================================================
  7. * DSMall多用户商城
  8. * ============================================================================
  9. * 版权所有 2014-2028 长沙德尚网络科技有限公司,并保留所有权利。
  10. * 网站地址: http://www.csdeshang.com
  11. * ----------------------------------------------------------------------------
  12. * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和使用 .
  13. * 不允许对程序代码以任何形式任何目的的再发布。
  14. * ============================================================================
  15. * 控制器
  16. */
  17. class BaseStoreSns extends BaseHome {
  18. const MAX_RECORDNUM = 20; // 允许插入新记录的最大次数,sns页面该常量是一样的。
  19. public function initialize() {
  20. parent::initialize();
  21. Lang::load(base_path() . 'home/lang/'.config('lang.default_lang').'/baseseller.lang.php');
  22. $this->template_dir = 'default/store/default/' . strtolower(request()->controller()) . '/';
  23. View::assign('store_theme','default');
  24. View::assign('max_recordnum', self::MAX_RECORDNUM);
  25. // 自定义导航条
  26. $this->getStorenavigation();
  27. //查询会员信息
  28. $this->getMemberAndGradeInfo(false);
  29. }
  30. // 自定义导航条
  31. protected function getStorenavigation() {
  32. $storenavigation_model = model('storenavigation');
  33. $store_navigation_list = $storenavigation_model->getStorenavigationList(array('storenav_store_id' => intval(input('param.sid'))));
  34. View::assign('store_navigation_list', $store_navigation_list);
  35. }
  36. protected function getStoreInfo($store_id) {
  37. //得到店铺等级信息
  38. $store_info = model('store')->getStoreInfoByID($store_id);
  39. if (empty($store_info)) {
  40. $this->error(lang('store_sns_store_not_exists'));
  41. }
  42. //处理地区信息
  43. $area_array = array();
  44. $area_array = explode("\t", $store_info["area_info"]);
  45. $map_city = lang('store_sns_city');
  46. $city = '';
  47. if (strpos($area_array[0], $map_city) !== false) {
  48. $city = $area_array[0];
  49. } else {
  50. $city = isset($area_array[1])?$area_array[1]:'';
  51. }
  52. $store_info['city'] = $city;
  53. $storejoinin_model=model('storejoinin');
  54. if(!$store_info['is_platform_store']){
  55. $storejoinin_info=$storejoinin_model->getOneStorejoinin(array('member_id'=>$store_info['member_id']));
  56. //营业执照
  57. if($storejoinin_info){
  58. $store_info['business_licence_number_electronic']=($storejoinin_info['business_licence_number_electronic'] && $storejoinin_info['store_type']==0)?get_store_joinin_imageurl($storejoinin_info['business_licence_number_electronic']):'';
  59. }
  60. }
  61. View::assign('store_theme', $store_info['store_theme']);
  62. View::assign('store_info', $store_info);
  63. }
  64. }
  65. ?>