BaseGoods.php 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. /*
  3. * 商品的类
  4. */
  5. namespace app\home\controller;
  6. /**
  7. * ============================================================================
  8. *
  9. * ============================================================================
  10. * 版权所有 2014-2028 浙江惠利玛产业互联网有限公司,并保留所有权利。
  11. * 网站地址: https://www.valimart.net/
  12. * ----------------------------------------------------------------------------
  13. *
  14. * ============================================================================
  15. * 控制器
  16. */
  17. class BaseGoods extends BaseStore {
  18. protected $store_info;
  19. public function initialize() {
  20. parent::initialize();
  21. //输出会员信息
  22. $this->getMemberAndGradeInfo(false);
  23. }
  24. protected function getStoreInfo($store_id, $goods_info = null) {
  25. $store_model = model('store');
  26. $store_info = $store_model->getStoreOnlineInfoByID($store_id);
  27. if (empty($store_info)) {
  28. $this->error(lang('ds_store_close'));
  29. }
  30. if (cookie('dregion')) {
  31. $store_info['deliver_region'] = cookie('dregion');
  32. }
  33. if (strpos($store_info['deliver_region'], '|')) {
  34. $store_info['deliver_region'] = explode('|', $store_info['deliver_region']);
  35. $store_info['deliver_region_ids'] = explode(' ', $store_info['deliver_region'][0]);
  36. $store_info['deliver_region_names'] = explode(' ', $store_info['deliver_region'][1]);
  37. }
  38. $storejoinin_model=model('storejoinin');
  39. if(!$store_info['is_platform_store']){
  40. $storejoinin_info=$storejoinin_model->getOneStorejoinin(array('member_id'=>$store_info['member_id']));
  41. //营业执照
  42. if($storejoinin_info){
  43. $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']):'';
  44. }
  45. }
  46. $this->outputStoreInfo($store_info, $goods_info);
  47. }
  48. }
  49. ?>