protected function formatArgs() { $args = parent::formatArgs(); $args['touser'] = $args['to']; unset($args['to']); return $args; }
die; } if ($action == "chooseCard") { $shopId = $_POST['shopId']; $cardType = $_POST['cardType']; $cardId = $_POST['cardId']; $appid = $_POST['appid']; $nonceStr = uniqid(); $time = time(); if (YDWX_WEIXIN_COMPONENT_APP_ID) { $card_jsapi_ticket = YDWXHook::do_hook(YDWXHook::GET_HOST_CARD_JSAPI_TICKET, $appid); } else { $card_jsapi_ticket = YDWXHook::do_hook(YDWXHook::GET_CARD_JSAPI_TICKET); } $array = array($nonceStr, $card_jsapi_ticket, $time, $shopId, $cardType, $cardId); $array = YDWXRequest::ignoreNull($array); sort($array); $cardSignStr = sha1(join("", $array)); echo json_encode(ydwx_success(array("shopId" => $shopId, "cardType" => $cardType, "cardId" => $cardId, "nonceStr" => $nonceStr, "time" => $time, "cardSign" => $cardSignStr))); die; } if ($action == "addCard") { $exts = $_POST['exts']; $appid = $_POST['appid']; if (YDWX_WEIXIN_COMPONENT_APP_ID) { $card_jsapi_ticket = YDWXHook::do_hook(YDWXHook::GET_HOST_CARD_JSAPI_TICKET, $appid); } else { $card_jsapi_ticket = YDWXHook::do_hook(YDWXHook::GET_CARD_JSAPI_TICKET); } $array = array(); foreach ($exts as $ext) {
protected function formatArgs() { $args = parent::formatArgs(); if (@$args['page_id']) { $args['page_id'] = intval($args['page_id']); } return $args; }
/** * 构建自己的数据结构,默认实现是把所有的非null属性组成数组返回 * @return multitype: */ protected function formatArgs() { return YDWXRequest::ignoreNull(get_object_vars($this)); }
protected function formatArgs() { $args = YDWXRequest::ignoreNull(parent::formatArgs()); $array = array(); $args['categories'] = (array) $this->categories; $photos = array(); foreach ((array) $this->photo_list as $photo) { $photos[] = array("photo_url" => $photo); } $args['photo_list'] = $photos; $array['business']['base_info'] = $args; return $array; }
public function sign() { //$long_url 签名用原串,传输需URLencode $this->valid(); $args = YDWXRequest::ignoreNull($this->sortArg()); $args['long_url'] = urldecode($args['long_url']); $str = http_build_query($args); $this->sign = strtoupper(md5(urldecode($str) . "&key=" . $this->mch_key)); }
protected function formatArgs() { if (!$this->nonce_str) { $this->nonce_str = uniqid(); } $args = parent::formatArgs(); $args['total_num'] = 1; $args['total_amount'] = intval($args['total_amount']); unset($args['mch_key']); return $args; }
protected function formatArgs() { $args = parent::formatArgs(); return $args; }