BaseGoods.php 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. /*
  3. * 商品的类
  4. */
  5. namespace app\home\controller;
  6. /**
  7. * ============================================================================
  8. *
  9. * ============================================================================
  10. *
  11. * ----------------------------------------------------------------------------
  12. *
  13. * ============================================================================
  14. * 控制器
  15. */
  16. class BaseGoods extends BaseStore {
  17. protected $store_info;
  18. public function initialize() {
  19. parent::initialize();
  20. //输出会员信息
  21. $this->getMemberAndGradeInfo(false);
  22. }
  23. protected function getStoreInfo($store_id, $goods_info = null) {
  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. }