示例#1
0
文件: msg.php 项目: qujian/ydwx
 protected function formatArgs()
 {
     $args = parent::formatArgs();
     $args['touser'] = $args['to'];
     unset($args['to']);
     return $args;
 }
示例#2
0
文件: card.php 项目: qujian/ydwx
    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) {
示例#3
0
文件: zb.php 项目: qujian/ydwx
 protected function formatArgs()
 {
     $args = parent::formatArgs();
     if (@$args['page_id']) {
         $args['page_id'] = intval($args['page_id']);
     }
     return $args;
 }
示例#4
0
文件: model.php 项目: qujian/ydwx
 /**
  * 构建自己的数据结构,默认实现是把所有的非null属性组成数组返回
  * @return multitype:
  */
 protected function formatArgs()
 {
     return YDWXRequest::ignoreNull(get_object_vars($this));
 }
示例#5
0
文件: poi.php 项目: qujian/ydwx
 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;
 }
示例#6
0
文件: pay.php 项目: qujian/ydwx
 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));
 }
示例#7
0
文件: packet.php 项目: qujian/ydwx
 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;
 }
示例#8
0
文件: card.php 项目: qujian/ydwx
 protected function formatArgs()
 {
     $args = parent::formatArgs();
     return $args;
 }