BaseGoods.php 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. /*
  3. * 商品的类
  4. */
  5. namespace app\home\controller;
  6. /**
  7. * ============================================================================
  8. * DSMall多用户商城
  9. * ============================================================================
  10. * 版权所有 2014-2028 长沙德尚网络科技有限公司,并保留所有权利。
  11. * 网站地址: http://www.csdeshang.com
  12. * ----------------------------------------------------------------------------
  13. * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和使用 .
  14. * 不允许对程序代码以任何形式任何目的的再发布。
  15. * ============================================================================
  16. * 控制器
  17. */
  18. class BaseGoods extends BaseStore {
  19. protected $store_info;
  20. public function initialize() {
  21. parent::initialize();
  22. //输出会员信息
  23. $this->getMemberAndGradeInfo(false);
  24. }
  25. protected function getStoreInfo($store_id, $goods_info = null) {
  26. $store_model = model('store');
  27. $store_info = $store_model->getStoreOnlineInfoByID($store_id);
  28. if (empty($store_info)) {
  29. $this->error(lang('ds_store_close'));
  30. }
  31. if (cookie('dregion')) {
  32. $store_info['deliver_region'] = cookie('dregion');
  33. }
  34. if (strpos($store_info['deliver_region'], '|')) {
  35. $store_info['deliver_region'] = explode('|', $store_info['deliver_region']);
  36. $store_info['deliver_region_ids'] = explode(' ', $store_info['deliver_region'][0]);
  37. $store_info['deliver_region_names'] = explode(' ', $store_info['deliver_region'][1]);
  38. }
  39. $storejoinin_model=model('storejoinin');
  40. if(!$store_info['is_platform_store']){
  41. $storejoinin_info=$storejoinin_model->getOneStorejoinin(array('member_id'=>$store_info['member_id']));
  42. //营业执照
  43. if($storejoinin_info){
  44. $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']):'';
  45. }
  46. }
  47. $this->outputStoreInfo($store_info, $goods_info);
  48. }
  49. }
  50. ?>