BaseGoods.php 1.8 KB

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