查询门店Wi-Fi信息
@param integer $shop_id 门店ID
@return array
@throws Exceptions\InvalidResponseException
@throws Exceptions\LocalCacheException
481121
public function getShopWifi($shop_id)
    {
        $url = 'https://api.weixin.qq.com/bizwifi/shop/list?access_token=ACCESS_TOKEN';
        $this->registerApi($url, __FUNCTION__, func_get_args());
        return $this->httpPostForJson($url, ['shop_id' => $shop_id]);
    }
1328971
public function listDiscounts($location_id)
    {
        list($response, $statusCode, $httpHeader) = $this->listDiscountsWithHttpInfo ($location_id);
        return $response; 
    }
5067
public function GetShopInfo($sShopInfoName)
    {
        $oInfo = TdbShopSystemInfo::GetNewInstance();
        if (!$oInfo->LoadFromFields(array('shop_id' => $this->id, 'name_internal' => $sShopInfoName))) {
            $oInfo = null;
        }

        return $oInfo;
    }
1025243
public function getCardList($openid, $card_id = null)
    {
        $data = ['openid' => $openid];
        is_null($card_id) || $data['card_id'] = $card_id;
        $url = "https://api.weixin.qq.com/card/user/getcardlist?access_token=ACCESS_TOKEN";
        $this->registerApi($url, __FUNCTION__, func_get_args());
        return $this->httpPostForJson($url, $data);
    }
610803
public function getPayprice($card_id, $quantity)
    {
        $url = "POST https://api.weixin.qq.com/card/pay/getpayprice?access_token=ACCESS_TOKEN";
        $this->registerApi($url, __FUNCTION__, func_get_args());
        return $this->httpPostForJson($url, ['card_id' => $card_id, 'quantity' => $quantity]);
    }
477561
public function orderByItemId($item_id)
    {
        if (!($item_id = (int) $item_id)) {
            return null; // Not possible.
        }
        $WpDb  = $this->s::wpDb(); // DB instance.
        $table = $WpDb->prefix.'woocommerce_order_items';

        $sql = /* Get the order ID for this item. */ '
            SELECT `order_id` FROM `'.esc_sql($table).'`
             WHERE `order_item_id` = %s LIMIT 1';
        $sql = $WpDb->prepare($sql, $item_id); // Prepare.

        if (!($order_id = (int) $WpDb->get_var($sql))) {
            return null; // Not possible; can't get order ID.
        } elseif (!($post_type = get_post_type($order_id))) {
            debug(0, $this->c::issue(vars(), 'Unable to acquire order post type.'));
            return null; // Not possible; can't get post type.
        }
        switch ($post_type) { // Based on post type.
            case 'shop_subscription':
                $subscription_id = $order_id; // It's a subscription ID.
                if (($WC_Subscription = wcs_get_subscription($subscription_id))) {
                    return $WC_Subscription;
                }
                return null; // Not possible.

            case 'shop_order':
            default: // Any other order type.
                if (($WC_Order = wc_get_order($order_id))) {
                    return $WC_Order;
                }
                return null; // Not possible.
        }
    }
1091854
public function getPayGiftCard($rule_id)
    {
        $url = "https://api.weixin.qq.com/card/paygiftcard/getbyid?access_token=ACCESS_TOKEN";
        $this->registerApi($url, __FUNCTION__, func_get_args());
        return $this->httpPostForJson($url, ['rule_id' => $rule_id]);
    }
170800
function fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)
	{
		static $_cache_info = array();

		$_smarty_old_error_level = $this->debugging ? error_reporting() : error_reporting(isset($this->error_reporting)
		? $this->error_reporting : error_reporting() & ~E_NOTICE);

		if (!$this->debugging && $this->debugging_ctrl == 'URL') {
			$_query_string = $this->request_use_auto_globals ? $_SERVER['QUERY_STRING'] : $GLOBALS['HTTP_SERVER_VARS']['QUERY_STRING'];
			if (@strstr($_query_string, $this->_smarty_debug_id)) {
				if (@strstr($_query_string, $this->_smarty_debug_id . '=on')) {
					// enable debugging for this browser session
					@setcookie('SMARTY_DEBUG', true);
					$this->debugging = true;
				} elseif (@strstr($_query_string, $this->_smarty_debug_id . '=off')) {
					// disable debugging for this browser session
					@setcookie('SMARTY_DEBUG', false);
					$this->debugging = false;
				} else {
					// enable debugging for this page
					$this->debugging = true;
				}
			} else {
				$this->debugging = (bool)($this->request_use_auto_globals ? @$_COOKIE['SMARTY_DEBUG'] : @$GLOBALS['HTTP_COOKIE_VARS']['SMARTY_DEBUG']);
			}
		}

		if ($this->debugging) {
			// capture time for debugging info
			$_params = array();
			require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
			$_debug_start_time = smarty_core_get_microtime($_params, $this);
			$this->_smarty_debug_info[] = array('type'      => 'template',
                                                'filename'  => $resource_name,
                                                'depth'     => 0);
			$_included_tpls_idx = count($this->_smarty_debug_info) - 1;
		}

		if (!isset($compile_id)) {
			$compile_id = $this->compile_id;
		}

		$this->_compile_id = $compile_id;
		$this->_inclusion_depth = 0;

		if ($this->caching) {
			// save old cache_info, initialize cache_info
			array_push($_cache_info, $this->_cache_info);
			$this->_cache_info = array();
			$_params = array(
                'tpl_file' => $resource_name,
                'cache_id' => $cache_id,
                'compile_id' => $compile_id,
                'results' => null
			);
			require_once(SMARTY_CORE_DIR . 'core.read_cache_file.php');
			if (smarty_core_read_cache_file($_params, $this)) {
				$_smarty_results = $_params['results'];
				if (!empty($this->_cache_info['insert_tags'])) {
					$_params = array('plugins' => $this->_cache_info['insert_tags']);
					require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
					smarty_core_load_plugins($_params, $this);
					$_params = array('results' => $_smarty_results);
					require_once(SMARTY_CORE_DIR . 'core.process_cached_inserts.php');
					$_smarty_results = smarty_core_process_cached_inserts($_params, $this);
				}
				if (!empty($this->_cache_info['cache_serials'])) {
					$_params = array('results' => $_smarty_results);
					require_once(SMARTY_CORE_DIR . 'core.process_compiled_include.php');
					$_smarty_results = smarty_core_process_compiled_include($_params, $this);
				}


				if ($display) {
					if ($this->debugging)
					{
						// capture time for debugging info
						$_params = array();
						require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
						$this->_smarty_debug_info[$_included_tpls_idx]['exec_time'] = smarty_core_get_microtime($_params, $this) - $_debug_start_time;
						require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');
						$_smarty_results .= smarty_core_display_debug_console($_params, $this);
					}
					if ($this->cache_modified_check) {
						$_server_vars = ($this->request_use_auto_globals) ? $_SERVER : $GLOBALS['HTTP_SERVER_VARS'];
						$_last_modified_date = @substr($_server_vars['HTTP_IF_MODIFIED_SINCE'], 0, strpos($_server_vars['HTTP_IF_MODIFIED_SINCE'], 'GMT') + 3);
						$_gmt_mtime = gmdate('D, d M Y H:i:s', $this->_cache_info['timestamp']).' GMT';
						if (@count($this->_cache_info['insert_tags']) == 0
						&& !$this->_cache_serials
						&& $_gmt_mtime == $_last_modified_date) {
							if (php_sapi_name()=='cgi')
							header('Status: 304 Not Modified');
							else
							header('HTTP/1.1 304 Not Modified');

						} else {
							header('Last-Modified: '.$_gmt_mtime);
							echo $_smarty_results;
						}
					} else {
						echo $_smarty_results;
					}
					error_reporting($_smarty_old_error_level);
					// restore initial cache_info
					$this->_cache_info = array_pop($_cache_info);
					return true;
				} else {
					error_reporting($_smarty_old_error_level);
					// restore initial cache_info
					$this->_cache_info = array_pop($_cache_info);
					return $_smarty_results;
				}
			} else {
				$this->_cache_info['template'][$resource_name] = true;
				if ($this->cache_modified_check && $display) {
					header('Last-Modified: '.gmdate('D, d M Y H:i:s', time()).' GMT');
				}
			}
		}

		// load filters that are marked as autoload
		if (count($this->autoload_filters)) {
			foreach ($this->autoload_filters as $_filter_type => $_filters) {
				foreach ($_filters as $_filter) {
					$this->load_filter($_filter_type, $_filter);
				}
			}
		}

		$_smarty_compile_path = $this->_get_compile_path($resource_name);

		// if we just need to display the results, don't perform output
		// buffering - for speed
		$_cache_including = $this->_cache_including;
		$this->_cache_including = false;
		if ($display && !$this->caching && count($this->_plugins['outputfilter']) == 0) {
			if ($this->_is_compiled($resource_name, $_smarty_compile_path)
			|| $this->_compile_resource($resource_name, $_smarty_compile_path))
			{
				include($_smarty_compile_path);
			}
		} else {
			ob_start();
			if ($this->_is_compiled($resource_name, $_smarty_compile_path)
			|| $this->_compile_resource($resource_name, $_smarty_compile_path))
			{
				include($_smarty_compile_path);
			}
			$_smarty_results = ob_get_contents();
			ob_end_clean();

			foreach ((array)$this->_plugins['outputfilter'] as $_output_filter) {
				$_smarty_results = call_user_func_array($_output_filter[0], array($_smarty_results, &$this));
			}
		}

		if ($this->caching) {
			$_params = array('tpl_file' => $resource_name,
                        'cache_id' => $cache_id,
                        'compile_id' => $compile_id,
                        'results' => $_smarty_results);
			require_once(SMARTY_CORE_DIR . 'core.write_cache_file.php');
			smarty_core_write_cache_file($_params, $this);
			require_once(SMARTY_CORE_DIR . 'core.process_cached_inserts.php');
			$_smarty_results = smarty_core_process_cached_inserts($_params, $this);

			if ($this->_cache_serials) {
				// strip nocache-tags from output
				$_smarty_results = preg_replace('!(\{/?nocache\:[0-9a-f]{32}#\d+\})!s'
				,''
				,$_smarty_results);
			}
			// restore initial cache_info
			$this->_cache_info = array_pop($_cache_info);
		}
		$this->_cache_including = $_cache_including;

		if ($display) {
			if (isset($_smarty_results)) { echo $_smarty_results; }
			if ($this->debugging) {
				// capture time for debugging info
				$_params = array();
				require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
				$this->_smarty_debug_info[$_included_tpls_idx]['exec_time'] = (smarty_core_get_microtime($_params, $this) - $_debug_start_time);
				require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');
				echo smarty_core_display_debug_console($_params, $this);
			}
			error_reporting($_smarty_old_error_level);
			return;
		} else {
			error_reporting($_smarty_old_error_level);
			if (isset($_smarty_results)) { return $_smarty_results; }
		}
	}
1250215
public function getItems($product_id)
    {
        $product_ids = array();
        foreach ($this->getList(array('product_id' => $product_id)) as $item) {
            $product_ids[] = $item['item_product_id'];
        }

        return $product_ids;
    }
580444
public function getNewsHtml($card_id)
    {
        $url = "https://api.weixin.qq.com/card/mpnews/gethtml?access_token=ACCESS_TOKEN";
        $this->registerApi($url, __FUNCTION__, func_get_args());
        return $this->httpPostForJson($url, ['card_id' => $card_id]);
    }
595595
public function Lists($magazine_id,$catalogue_id=0,$pagesize=10,$status='all'){
		 
		if($status=='-1' || $status=='1' || $status=='0' ){
			$whereStatus = [
			'status'=> $status
			];
		}else{
				
			$whereStatus = 'status >= 0';
		}
		
		//如启用mongodb则使用mongodb
		if($this->mongodb){
			$res = $this->mongodbLists($pagesize);
			return $res;
			exit(0);
		}
	
		//mysql
		// 查询状态为1的用户数据 并且每页显示10条数据
		if($catalogue_id>0){
			
			$list = self::with('MagazineArticleStats')->where(['magazine_id'=>$magazine_id,'catalogue_id'=>$catalogue_id])
			->where($whereStatus)
			->paginate($pagesize);
		}else{
			$list = self::with('MagazineArticleStats')->where(['magazine_id'=>$magazine_id])
			->where($whereStatus)
			->paginate($pagesize);
		}
		
		// 获取分页显示
		$page = $list->render();
	
		$res['list'] = $list->items();
		$res['render'] = $list;
		$res['page'] = $page;
		return $res;
	}
139980
public function getOrderByID($order_id){
		if (!$this->access_token && !$this->checkAuth()) return false;
		if (!$order_id) return false;

		$data = array(
			'order_id'=>$order_id
		);
		$result = $this->http_post(self::API_BASE_URL_PREFIX.self::MERCHANT_ORDER_GETBYID.'access_token='.$this->access_token, self::json_encode($data));
		if ($result)
		{
			$json = json_decode($result,true);
			if (isset($json['errcode']) && $json['errcode']) {
				$this->errCode = $json['errcode'];
				$this->errMsg = $json['errmsg'];
				return false;
			}
			return $json['order'];
		}
		return false;
	}
777060
public function delPayGiftCard($rule_id)
    {
        $url = "https://api.weixin.qq.com/card/paygiftcard/add?access_token=ACCESS_TOKEN";
        $this->registerApi($url, __FUNCTION__, func_get_args());
        return $this->httpPostForJson($url, ['rule_id' => $rule_id]);
    }
473058
public function openidWxcard($card_id = '', $openids = [])
    {
        $queryStr                      = [];
        $queryStr['touser']            = $openids;
        $queryStr['wxcard']['card_id'] = $card_id;
        $queryStr['msgtype']           = 'wxcard';

        $this->module = 'message';

        $res = $this->_post('mass/send', $queryStr);

        return $res;
    }
635627
public function listFees($location_id)
    {
        list($response, $statusCode, $httpHeader) = $this->listFeesWithHttpInfo ($location_id);
        return $response; 
    }
668692
def list_shops(self, page_index=1, page_size=20):
        
        res = self._post(
            'shop/list',
            data={
                'pageindex': page_index,
                'pagesize': page_size,
            },
            result_processor=lambda x: x['data']
        )
        return res
434420
public function getActiveShopId()
    {
        if (($sValue = $this->getViewConfigParam('shopid')) === null) {
            $sValue = $this->getConfig()->getShopId();
            $this->setViewConfigParam('shopid', $sValue);
        }

        return $sValue;
    }