当前位置: 首页>>代码示例>>PHP>>正文


PHP object_array函数代码示例

本文整理汇总了PHP中object_array函数的典型用法代码示例。如果您正苦于以下问题:PHP object_array函数的具体用法?PHP object_array怎么用?PHP object_array使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了object_array函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: callback

 function callback($data)
 {
     //     	$request_data = get_post(NULL);
     $request_data = $data['request_data'];
     $return_data = json_decode($data['return_data']);
     $return_data = object_array($return_data);
     if ($return_data['rsp'] == 'succ') {
         //回调接口
         $callback_data = array();
         $callback_data['res'] = '';
         $callback_data['msg_id'] = $data['msg_id'];
         $callback_data['err_msg'] = '';
         $callback_data['data'] = json_encode($return_data['data']);
         $callback_data['sign'] = '';
         $callback_data['rsp'] = 'succ';
     } else {
         $callback_data = array();
         $callback_data['res'] = $return_data['res'];
         $callback_data['msg_id'] = $data['msg_id'];
         $callback_data['err_msg'] = '';
         $callback_data['data'] = json_encode($return_data['data']);
         $callback_data['sign'] = '';
         $callback_data['rsp'] = 'fail';
     }
     return array('callback_data' => $callback_data, 'callback_url' => $request_data['callback_url']);
 }
开发者ID:xingfuunit,项目名称:matrix,代码行数:26,代码来源:store_trade_payment_add.php

示例2: callback

 function callback($data)
 {
     //	$request_data = get_post(NULL);
     $request_data = $data['request_data'];
     $return_data = json_decode($data['return_data']);
     $return_data = object_array($return_data);
     $CI =& get_instance();
     $CI->load->model('stream_model');
     $order_rs = $CI->stream_model->findByAttributes("order_bn = '" . $request_data['tid'] . "' and from_method='store.trade.reship.add'", 'stream_id desc');
     $reship_id = '';
     if ($order_rs) {
         $request_rs = mb_unserialize($order_rs['request_data']);
         $reship_id = $request_rs['reship_id'];
     }
     if ($return_data['rsp'] == 'succ') {
         //回调接口
         $callback_data = array();
         $callback_data['res'] = '';
         $callback_data['msg_id'] = $data['msg_id'];
         $callback_data['err_msg'] = '';
         $callback_data['data'] = json_encode(array('tid' => $request_data['tid'], 'reship_id' => $reship_id));
         $callback_data['sign'] = '';
         $callback_data['rsp'] = 'succ';
     } else {
         $callback_data = array();
         $callback_data['res'] = $return_data['res'];
         $callback_data['msg_id'] = $data['msg_id'];
         $callback_data['err_msg'] = '';
         $callback_data['data'] = json_encode(array('tid' => $request_data['tid'], 'reship_id' => $reship_id));
         $callback_data['sign'] = '';
         $callback_data['rsp'] = 'fail';
     }
     return array('callback_data' => $callback_data, 'callback_url' => $request_data['callback_url']);
 }
开发者ID:xingfuunit,项目名称:matrix,代码行数:34,代码来源:store_trade_aftersale_status_update.php

示例3: result

 function result($params)
 {
     $return_data = json_decode($params['return_data']);
     $return_data = object_array($return_data);
     $response_data = $params['response_data'];
     if ($return_data['rsp'] != 'succ') {
         return json_encode(array('res' => $return_data['res'], 'msg_id' => $params['msg_id'], 'rsp' => 'fail', 'err_msg' => '', 'data' => ''));
     } else {
         return json_encode(array('res' => $return_data['res'], 'msg_id' => $params['msg_id'], 'rsp' => 'running', 'err_msg' => '', 'data' => ''));
     }
 }
开发者ID:xingfuunit,项目名称:matrix,代码行数:11,代码来源:store_trade_buyer_message_add.php

示例4: result

 function result($post_data)
 {
     $return_data = json_decode($post_data['return_data']);
     $return_data = object_array($return_data);
     if ($return_data['rsp'] == 'succ') {
         $re = array('res' => '', 'msg_id' => $post_data['msg_id'], 'err_msg' => '', 'data' => $return_data['data'], 'rsp' => 'succ', 'res_ltype' => $return_data['data']['total_results']);
         return json_encode($re);
     } else {
         return '{"res": "", "msg_id": "' . $post_data['msg_id'] . '", "rsp": "fail", "err_msg": "", "data": ""}';
     }
 }
开发者ID:xingfuunit,项目名称:matrix,代码行数:11,代码来源:store_trades_sold_get.php

示例5: object_array

/**
 * json数据 转换 数组
 */
function object_array($array)
{
    if (is_object($array)) {
        $array = (array) $array;
    }
    if (is_array($array)) {
        foreach ($array as $key => $value) {
            $array[$key] = object_array($value);
        }
    }
    return $array;
}
开发者ID:koery,项目名称:Vcanbuy,代码行数:15,代码来源:functions.php

示例6: push

 public function push()
 {
     $ret = $this->_avpush->send();
     $ret = object_array($ret);
     if ($ret['objectId']) {
         $ret['errcode'] = 0;
         $ret['msg_id'] = $ret['objectId'];
         $ret['errmsg'] = '发送成功';
     } else {
         $ret['errcode'] = 1;
         $ret['errmsg'] = '发送失败';
     }
     return $ret;
 }
开发者ID:h3len,项目名称:Project,代码行数:14,代码来源:pushMessage.php

示例7: callback

 function callback($data)
 {
     // 	$request_data = get_post(NULL);
     $request_data = $data['request_data'];
     $return_data = json_decode($data['return_data']);
     $return_data = object_array($return_data);
     sort($return_data['data']);
     //回调接口
     $callback_data = array();
     $callback_data['res'] = '';
     $callback_data['err_msg'] = '';
     $callback_data['data'] = json_encode($this->build_data($return_data['data']));
     $callback_data['sign'] = '';
     $callback_data['rsp'] = 'succ';
     $callback_data['msg_id'] = $data['msg_id'];
     return array('callback_data' => $callback_data, 'callback_url' => $request_data['callback_url']);
 }
开发者ID:xingfuunit,项目名称:matrix,代码行数:17,代码来源:store_shop_payment_type_list_get.php

示例8: create_fqrforreg

 public function create_fqrforreg()
 {
     $dotype = '777800';
     $uid = $dotype;
     $param = array('expire_seconds' => 2592000, 'action_name' => 'QR_SCENE', 'action_info' => array('scene' => array('scene_id' => $uid)));
     $param = json_encode($param);
     $wxmsg = new WxUserInfo();
     $access_token = $wxmsg->accessToken();
     $rs = post('https://api.weixin.qq.com/cgi-bin/qrcode/create?access_token=' . $access_token, $param);
     $rs = json_decode($rs);
     //处理object
     $rs = object_array($rs);
     header('location:https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=' . $rs['ticket']);
 }
开发者ID:Jitlee,项目名称:YYG,代码行数:14,代码来源:KanjiaController.class.php

示例9: result

 function result($data)
 {
     $return_data = json_decode($data['return_data']);
     $return_data = object_array($return_data);
     $data_rs = array();
     $promotion_details = object_array(json_decode($return_data['data']['promotion_details']));
     $data_rs['trade']['discount_fee'] = $return_data['data']['discount_fee'];
     $data_rs['trade']['promotion_details'] = $promotion_details;
     $data_rs['trade']['buyer_name'] = $return_data['data']['buyer_name'];
     $data_rs['trade']['is_cod'] = $return_data['data']['is_cod'];
     $data_rs['trade']['receiver_email'] = $return_data['data']['receiver_email'];
     $data_rs['trade']['point_fee'] = $return_data['data']['point_fee'];
     $data_rs['trade']['currency_rate'] = $return_data['data']['currency_rate'];
     $data_rs['trade']['currency'] = $return_data['data']['currency'];
     $data_rs['trade']['total_weight'] = $return_data['data']['total_weight'];
     $data_rs['trade']['total_currency_fee'] = $return_data['data']['total_currency_fee'];
     $data_rs['trade']['shipping_type'] = $return_data['data']['shipping_type'];
     $data_rs['trade']['receiver_address'] = $return_data['data']['receiver_address'];
     $data_rs['trade']['payment_tid'] = $return_data['data']['receiver_zip'];
     $orders = object_array(json_decode($return_data['data']['orders']));
     foreach ($orders['order'] as $key => $value) {
         $item = $orders['order'][$key]['order_items']['item'];
         unset($orders['order'][$key]['order_items']);
         $orders['order'][$key]['order_items']['orderitem'] = $item;
     }
     $data_rs['trade']['orders'] = $orders;
     $data_rs['trade']['trade_memo'] = $return_data['data']['trade_memo'];
     $data_rs['trade']['lastmodify'] = $return_data['data']['lastmodify'];
     $data_rs['trade']['branch_id'] = $return_data['data']['branch_id'];
     $data_rs['trade']['has_invoice'] = $return_data['data']['has_invoice'];
     $data_rs['trade']['receiver_district'] = $return_data['data']['receiver_district'];
     $data_rs['trade']['receiver_city'] = $return_data['data']['receiver_city'];
     $data_rs['trade']['title'] = $return_data['data']['title'];
     $data_rs['trade']['orders_discount_fee'] = $return_data['data']['orders_discount_fee'];
     $data_rs['trade']['tax_type'] = $return_data['data']['tax_type'];
     $data_rs['trade']['buyer_memo'] = $return_data['data']['buyer_memo'];
     $data_rs['trade']['invoice_title'] = $return_data['data']['invoice_title'];
     $data_rs['trade']['receiver_state'] = $return_data['data']['receiver_state'];
     $data_rs['trade']['branch_name_user'] = $return_data['data']['branch_name_user'];
     $data_rs['trade']['local_id'] = $return_data['data']['local_id'];
     $data_rs['trade']['tax_content'] = $return_data['data']['tax_content'];
     $data_rs['trade']['receiver_time'] = $return_data['data']['receiver_time'];
     $data_rs['trade']['protect_fee'] = $return_data['data']['protect_fee'];
     $data_rs['trade']['receiver_phone'] = $return_data['data']['receiver_phone'];
     $data_rs['trade']['pay_status'] = $return_data['data']['pay_status'];
     $data_rs['trade']['shop_bn'] = $return_data['data']['shop_bn'];
     $data_rs['trade']['status'] = $return_data['data']['status'];
     $data_rs['trade']['total_trade_fee'] = $return_data['data']['total_trade_fee'];
     $data_rs['trade']['buyer_address'] = $return_data['data']['buyer_address'];
     $data_rs['trade']['pay_cost'] = $return_data['data']['pay_cost'];
     $data_rs['trade']['buyer_uname'] = $return_data['data']['buyer_uname'];
     $data_rs['trade']['buyer_email'] = $return_data['data']['buyer_email'];
     $data_rs['trade']['tid'] = $return_data['data']['tid'];
     $data_rs['trade']['receiver_community'] = $return_data['data']['receiver_community'];
     $data_rs['trade']['buyer_zip'] = $return_data['data']['buyer_zip'];
     $payment_lists = object_array(json_decode($return_data['data']['payment_lists']));
     $data_rs['trade']['payment_lists'] = $payment_lists;
     $data_rs['trade']['receiver_mobile'] = $return_data['data']['receiver_mobile'];
     $data_rs['trade']['buyer_mobile'] = $return_data['data']['buyer_mobile'];
     $data_rs['trade']['goods_discount_fee'] = $return_data['data']['goods_discount_fee'];
     $data_rs['trade']['orders_number'] = $return_data['data']['orders_number'];
     $data_rs['trade']['shipping_tid'] = $return_data['data']['shipping_tid'];
     $data_rs['trade']['total_goods_fee'] = $return_data['data']['total_goods_fee'];
     $data_rs['trade']['created'] = $return_data['data']['created'];
     $data_rs['trade']['is_auto_complete'] = $return_data['data']['is_auto_complete'];
     $data_rs['trade']['payed_fee'] = $return_data['data']['payed_fee'];
     $data_rs['trade']['invoice_fee'] = $return_data['data']['invoice_fee'];
     $data_rs['trade']['modified'] = $return_data['data']['modified'];
     $data_rs['trade']['is_protect'] = $return_data['data']['is_protect'];
     $data_rs['trade']['ship_status'] = $return_data['data']['ship_status'];
     $data_rs['trade']['buyer_obtain_point_fee'] = $return_data['data']['buyer_obtain_point_fee'];
     $data_rs['trade']['payment_type'] = $return_data['data']['payment_type'];
     $data_rs['trade']['buyer_phone'] = $return_data['data']['buyer_phone'];
     $data_rs['trade']['receiver_name'] = $return_data['data']['receiver_name'];
     $data_rs['trade']['shipping_fee'] = $return_data['data']['shipping_fee'];
     $data_rs['trade']['receiver_zip'] = $return_data['data']['receiver_zip'];
     $data_rs['trade']['buyer_id'] = $return_data['data']['buyer_id'];
     $result_data = array();
     $result_data['res'] = '';
     $result_data['msg_id'] = $data['msg_id'];
     $result_data['err_msg'] = '';
     $result_data['data'] = json_encode($data_rs);
     $result_data['rsp'] = 'succ';
     //	error_log(json_encode($result_data),3,'e.log');
     return json_encode($result_data);
     //	$txt = print_r($result_data,1);
     //	return '{"res":"","msg_id":"5534B399C0A81729C278EEB1F8539164","err_msg":"","data":"{\"trade\": {\"discount_fee\": \"0.00\", \"promotion_details\": [{\"promotion_fee\": \"0.00\", \"promotion_name\": \"\u6ce8\u518c\u4f1a\u5458\u53ca\u94f6\u5361\u4f1a\u5458\u6d88\u8d391\u5143\u79ef\u5206+1\"}], \"buyer_name\": \"\", \"is_cod\": null, \"receiver_email\": \"\", \"point_fee\": \"0.00\", \"currency_rate\": \"1.0000\", \"currency\": \"CNY\", \"total_weight\": \"800.00\", \"total_currency_fee\": \"101.24\", \"shipping_type\": \"\u987a\u4e30\", \"receiver_address\": \"\u5e7f\u4e1c\u5e7f\u5dde\u5e02\u4e1c\u5c71\u533a11\", \"payment_tid\": \"deposit\", \"orders\": {\"order\": [{\"consign_time\": \"\", \"weight\": \"800\", \"title\": \"\u65b0\u897f\u5170\u6d3b\u7eff\u9752\u53e3\u3010\u9884\u552e\u3011\", \"discount_fee\": 0, \"type\": \"goods\", \"price\": \"88.000\", \"oid\": \"25150\", \"order_status\": \"SHIP_NO\", \"order_items\": {\"orderitem\": [{\"sku_id\": \"1148\", \"name\": \"\u65b0\u897f\u5170\u6d3b\u7eff\u9752\u53e3\u3010\u9884\u552e\u3011\", \"weight\": \"800\", \"iid\": \"14\", \"discount_fee\": 0, \"bn\": \"11002401\", \"sku_properties\": \"\u89c4\u683c:800g\/\u76d2\", \"item_status\": \"normal\", \"item_type\": \"product\", \"num\": \"1\", \"sendnum\": \"0\", \"sale_price\": \"86.240\", \"score\": \"86\", \"price\": \"86.240\", \"total_item_fee\": 86.239999999999995}]}, \"iid\": \"25150\", \"type_alias\": \"\u5546\u54c1\u533a\u5757\", \"total_order_fee\": 86.239999999999995, \"items_num\": 1, \"orders_bn\": \"11002401\"}]}, \"trade_memo\": null, \"lastmodify\": \"2015-04-20 15:57:06\", \"branch_id\": 0, \"has_invoice\": false, \"receiver_district\": \"\u4e1c\u5c71\u533a\", \"receiver_city\": \"\u5e7f\u5dde\u5e02\", \"title\": \"Order Create\", \"orders_discount_fee\": \"0.00\", \"tax_type\": \"false\", \"buyer_memo\": \"\", \"invoice_title\": \"\", \"receiver_state\": \"\u5e7f\u4e1c\", \"branch_name_user\": \"\", \"local_id\": null, \"tax_content\": \"\", \"receiver_time\": \"\u4efb\u610f\u65e5\u671f,\u4efb\u610f\u65f6\u95f4\u6bb5\", \"protect_fee\": \"0.00\", \"receiver_phone\": \"\", \"pay_status\": \"PAY_NO\", \"shop_bn\": \"xbd_store_\", \"status\": \"TRADE_ACTIVE\", \"total_trade_fee\": \"101.24\", \"buyer_address\": \"\", \"pay_cost\": \"0.00\", \"buyer_uname\": \"freedom\", \"buyer_email\": \"171868746@qq.com\", \"tid\": \"150420155724776\", \"receiver_community\": \"\", \"buyer_zip\": null, \"payment_lists\": {\"payment_list\": []}, \"receiver_mobile\": \"13690182120\", \"buyer_mobile\": \"\", \"goods_discount_fee\": \"0.00\", \"orders_number\": 1, \"shipping_tid\": \"1\", \"total_goods_fee\": \"86.24\", \"created\": \"2015-04-20 15:57:06\", \"is_auto_complete\": \"false\", \"payed_fee\": \"0.00\", \"invoice_fee\": \"0.00\", \"modified\": \"2015-04-20 15:57:06\", \"is_protect\": \"false\", \"ship_status\": \"SHIP_NO\", \"buyer_obtain_point_fee\": \"86.00\", \"payment_type\": \"\u9884\u5b58\u6b3e\", \"buyer_phone\": \"\", \"receiver_name\": \"13690182120\", \"shipping_fee\": \"15.00\", \"receiver_zip\": \"\", \"buyer_id\": 343}}","rsp":"succ"}';
 }
开发者ID:xingfuunit,项目名称:matrix,代码行数:88,代码来源:store_trade_fullinfo_get.php

示例10: result

 function result($params)
 {
     //return json_encode(array('res'=>'', 'msg_id'=>$post_data['msg_id'], 'rsp'=>'running', 'err_msg'=>'', 'data'=>''));
     //return '{"res": "", "msg_id": "'.$post_data['msg_id'].'", "rsp": "running", "err_msg": "", "data": ""}';
     $return_data = json_decode($params['return_data']);
     $return_data = object_array($return_data);
     if ($return_data['rsp'] != 'succ') {
         return json_encode(array('res' => $return_data['res'], 'msg_id' => $params['msg_id'], 'rsp' => 'fail', 'err_msg' => '', 'data' => ''));
     } else {
         return json_encode(array('res' => $return_data['res'], 'msg_id' => $params['msg_id'], 'rsp' => 'running', 'err_msg' => '', 'data' => ''));
     }
 }
开发者ID:xingfuunit,项目名称:matrix,代码行数:12,代码来源:store_trade_add.php

示例11: postCurl

 /**
  * CURL Post
  */
 private function postCurl($url, $option, $header = 0, $type = 'POST')
 {
     $curl = curl_init();
     // 启动一个CURL会话
     curl_setopt($curl, CURLOPT_URL, $url);
     // 要访问的地址
     curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
     // 对认证证书来源的检查
     curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE);
     // 从证书中检查SSL加密算法是否存在
     curl_setopt($curl, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0)');
     // 模拟用户使用的浏览器
     if (!empty($option)) {
         $options = json_encode($option);
         curl_setopt($curl, CURLOPT_POSTFIELDS, $options);
         // Post提交的数据包
     }
     curl_setopt($curl, CURLOPT_TIMEOUT, 30);
     // 设置超时限制防止死循环
     curl_setopt($curl, CURLOPT_HTTPHEADER, $header);
     // 设置HTTP头
     curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
     // 获取的信息以文件流的形式返回
     curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $type);
     $result = curl_exec($curl);
     // 执行操作
     $res = object_array(json_decode($result));
     $res['status'] = curl_getinfo($curl, CURLINFO_HTTP_CODE);
     pre($res);
     return $res;
     curl_close($curl);
     // 关闭CURL会话
 }
开发者ID:asfeixue,项目名称:emchat-server-examples,代码行数:36,代码来源:Easemob.class.php

示例12: create_qr

 public function create_qr($openid = '', $type, $dotype = '1001')
 {
     //找到此用户的uid
     $uid = M('member')->where(array('OpenID' => $openid))->limit(1)->getField('uid');
     $uid = $dotype . $type . $uid;
     //https://api.weixin.qq.com/cgi-bin/qrcode/create?access_token=TOKEN
     //{"expire_seconds": 604800, "action_name": "QR_SCENE", "action_info": {"scene": {"scene_id": 123}}}
     $param = array('expire_seconds' => 2592000, 'action_name' => 'QR_SCENE', 'action_info' => array('scene' => array('scene_id' => $uid)));
     $param = json_encode($param);
     $wxmsg = new WxUserInfo();
     $access_token = $wxmsg->accessToken();
     $rs = post('https://api.weixin.qq.com/cgi-bin/qrcode/create?access_token=' . $access_token, $param);
     $rs = json_decode($rs);
     //处理object
     $rs = object_array($rs);
     return 'https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=' . $rs['ticket'];
 }
开发者ID:Jitlee,项目名称:CKY,代码行数:17,代码来源:WxMsgKanjia.class.php

示例13: create_qr111

 public function create_qr111($openid = 'oyKgswI_fyh9dM5rdw6SAEy0dEUg', $type = 1)
 {
     //找到此用户的uid
     $uid = M('member')->where(array('openid' => $openid))->limit(1)->getField('uid');
     $uid = $type . $uid;
     //https://api.weixin.qq.com/cgi-bin/qrcode/create?access_token=TOKEN
     //{"expire_seconds": 604800, "action_name": "QR_SCENE", "action_info": {"scene": {"scene_id": 123}}}
     $param = array('expire_seconds' => 2592000, 'action_name' => 'QR_SCENE', 'action_info' => array('scene' => array('scene_id' => $uid)));
     $param = json_encode($param);
     // S('access_token',null);die;
     // echo S('access_token');die;
     $rs = post('https://api.weixin.qq.com/cgi-bin/qrcode/create?access_token=' . S('access_token'), $param);
     $rs = json_decode($rs);
     //处理object
     $rs = object_array($rs);
     echo 'https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=' . $rs['ticket'];
     // print_r($rs);
 }
开发者ID:Jitlee,项目名称:CKY,代码行数:18,代码来源:IndexController.class.php

示例14: spiderOrderLists

 /**
  * 根据订单号抓取订单列表
  * @param datetime $starttime
  * @param datetime $endtime
  * @return array
  * @author lzx
  */
 public function spiderOrderLists($starttime, $endtime)
 {
     $OrderObject = F('amazon.package.GetOrders');
     F('xmlhandle');
     $OrderObject->setRequestConfig($this->authorize);
     $simplelists = array();
     //使用启用缓存方便调试:0:不使用; 1:正常使用缓存; 2:更新缓存中的数据
     if (!empty($GLOBALS['memc_obj']) && C('ENABLE_AMAZON_GET_ORDER_CACHE') != 0) {
         $cache_mode = C('ENABLE_AMAZON_GET_ORDER_CACHE');
         $simplelists = $GLOBALS['memc_obj']->get('ENABLE_AMAZON_GET_ORDER_CACHE');
         if (empty($simplelists) || $cache_mode == 2) {
             $simplelists = $OrderObject->getOrderLists($starttime, $endtime);
             //amazon订单数据存入缓存
             $GLOBALS['memc_obj']->set('ENABLE_AMAZON_GET_ORDER_CACHE', $simplelists, 10800);
         }
     } else {
         $simplelists = $OrderObject->getOrderLists($starttime, $endtime);
     }
     $StatusMenu = M('StatusMenu');
     $ORDER_INIT = $StatusMenu->getOrderStatusByStatusCode('ORDER_INIT', 'id');
     foreach ($simplelists as $xml_simplelist) {
         $simplelist = object_array($xml_simplelist);
         $orders = $simplelist['' . "" . '*' . "" . '_fields']['Orders']['FieldValue'];
         foreach ($orders as $order) {
             $orderInfo = $order['' . "" . '*' . "" . '_fields'];
             //订单表数据
             $order = array('recordNumber' => $orderInfo['AmazonOrderId']['FieldValue'], 'platformId' => 11, 'site' => $this->authorize['site'], 'paymentMethod' => $orderInfo['PaymentMethod']['FieldValue'], 'currency' => $orderInfo['OrderTotal']['FieldValue']['' . "" . '*' . "" . '_fields']['CurrencyCode']['FieldValue'], 'accountId' => M('Account')->getAccountIdByName($this->authorize['account']), 'ordersTime' => strtotime($orderInfo['PurchaseDate']['FieldValue']), 'paymentTime' => strtotime($orderInfo['LastUpdateDate']['FieldValue']), 'onlineTotal' => $orderInfo['OrderTotal']['FieldValue']['' . "" . '*' . "" . '_fields']['Amount']['FieldValue'], 'actualTotal' => $orderInfo['OrderTotal']['FieldValue']['' . "" . '*' . "" . '_fields']['Amount']['FieldValue'], 'transportId' => 0, 'actualShipping' => 0, 'marketTime' => 0, 'ShippedTime' => 0, 'ORtransport' => $orderInfo['ShipServiceLevel']['FieldValue'], 'orderStatus' => $ORDER_INIT, 'orderType' => $ORDER_INIT, 'orderAttribute' => 1, 'pmId' => 0, 'channelId' => 0, 'calcWeight' => 0, 'calcShipping' => 0, 'orderAddTime' => time(), 'isSendEmail' => 0, 'isNote' => 0, 'isCopy' => 0, 'isSplit' => 0, 'combinePackage' => 0, 'combineOrder' => 0, 'completeTime' => 0, 'storeId' => 1, 'is_offline' => 0, 'is_delete' => 0, 'isExpressDelivery' => 0);
             //订单扩展表
             $orderExtension = array('declaredPrice' => 0.0, 'orderStatus' => $orderInfo['OrderStatus']['FieldValue'], 'fulfillmentChannel' => $orderInfo['FulfillmentChannel']['FieldValue'], 'salesChannel' => $orderInfo['SalesChannel']['FieldValue'], 'shipServiceLevel' => $orderInfo['ShipServiceLevel']['FieldValue'], 'marketplaceId' => $orderInfo['MarketplaceId']['FieldValue'], 'shipmentServiceLevelCategory' => $orderInfo['ShipmentServiceLevelCategory']['FieldValue']);
             $ShippingAddress = $orderInfo['ShippingAddress']['FieldValue']['' . "" . '*' . "" . '_fields'];
             $street2 = htmlentities($ShippingAddress['AddressLine1']['FieldValue']);
             $street3 = htmlentities($ShippingAddress['AddressLine2']['FieldValue']);
             if (!empty($ShippingAddress['County']['FieldValue'])) {
                 //郡,县
                 $street2 = htmlentities($ShippingAddress['County']['FieldValue'] . ' ' . $street2, ENT_QUOTES);
                 $street3 = htmlentities($ShippingAddress['County']['FieldValue'] . ' ' . $street3, ENT_QUOTES);
             }
             $countrySn = $ShippingAddress['CountryCode']['FieldValue'] == 'GB' ? 'UK' : $ShippingAddress['CountryCode']['FieldValue'];
             $countryNameInfo = M('Order')->getCountrieInfoBySn($countrySn);
             $countryName = $countryNameInfo['regions_en'];
             //用户表
             $orderUserInfo = array('username' => htmlentities($ShippingAddress['Name']['FieldValue'], ENT_QUOTES), 'platformUsername' => htmlentities($orderInfo['BuyerName']['FieldValue'], ENT_QUOTES), 'email' => $orderInfo['BuyerEmail']['FieldValue'], 'countryName' => $countryName, 'countrySn' => $countrySn, 'county' => '', 'currency' => $orderInfo['OrderTotal']['FieldValue']['' . "" . '*' . "" . '_fields']['CurrencyCode']['FieldValue'], 'state' => htmlentities($ShippingAddress['StateOrRegion']['FieldValue'], ENT_QUOTES), 'city' => htmlentities($ShippingAddress['City']['FieldValue'], ENT_QUOTES), 'address1' => htmlentities($ShippingAddress['AddressLine1']['FieldValue']), 'address2' => $street2, 'address3' => $street3, 'phone' => $ShippingAddress['Phone']['FieldValue'], 'zipCode' => htmlentities($ShippingAddress['PostalCode']['FieldValue'], ENT_QUOTES));
             //订单详细表
             //使用启用缓存方便调试:0:不使用; 1:正常使用缓存; 2:更新缓存中的数据
             if (!empty($GLOBALS['memc_obj']) && C('ENABLE_AMAZON_GET_ORDER_CACHE') != 0) {
                 $cache_mode = C('ENABLE_AMAZON_GET_ORDER_CACHE');
                 $orderDetailObjList = $GLOBALS['memc_obj']->get('ENABLE_AMAZON_GET_ORDER_DETAIL_CACHE');
                 if (empty($orderDetailObjList) || $cache_mode == 2) {
                     $orderDetailObjList = $OrderObject->getOrderDetailLists($orderInfo['AmazonOrderId']['FieldValue']);
                     //amazon订单数据存入缓存
                     $GLOBALS['memc_obj']->set('ENABLE_AMAZON_GET_ORDER_DETAIL_CACHE', $orderDetailObjList, 10800);
                 }
             } else {
                 $orderDetailObjList = $OrderObject->getOrderDetailLists($orderInfo['AmazonOrderId']['FieldValue']);
             }
             $orderDetailLists = object_array($orderDetailObjList);
             $orderDetail = array();
             foreach ($orderDetailLists as $orderDetailList) {
                 $orderDetails = $orderDetailList['' . "" . '*' . "" . '_fields']['OrderItems']['FieldValue'];
                 foreach ($orderDetails as $orderItems) {
                     $orderItem = $orderItems['' . "" . '*' . "" . '_fields'];
                     $itemPrices = $orderItem['ItemPrice']['FieldValue']['' . "" . '*' . "" . '_fields'];
                     $orderDetail[] = array('orderDetail' => array('recordNumber' => $orderItem['OrderItemId']['FieldValue'], 'itemPrice' => round($itemPrices['Amount']['FieldValue'] / $orderItem['QuantityOrdered']['FieldValue'], 2), 'sku' => str_pad(preg_replace('/^(0|\\*)*/', '', $orderItem['SellerSKU']['FieldValue']), 3, '0', STR_PAD_LEFT), 'amount' => $orderItem['QuantityOrdered']['FieldValue'], 'shippingFee' => 0, 'createdTime' => time(), 'storeId' => 1, 'is_delete' => 0, 'itemId' => $orderItem['ASIN']['FieldValue']), 'orderDetailExtension' => array('itemTitle' => htmlentities($orderItem['Title']['FieldValue'], ENT_QUOTES), 'itemURL' => '', 'shippingTax' => $orderItem['ShippingTax']['FieldValue']['' . "" . '*' . "" . '_fields']['Amount']['FieldValue'], 'shippingDiscount' => $orderItem['ShippingDiscount']['FieldValue']['' . "" . '*' . "" . '_fields']['Amount']['FieldValue'], 'shippingPrice' => $orderItem['ShippingPrice']['FieldValue']['' . "" . '*' . "" . '_fields']['Amount']['FieldValue'], 'conditionNote' => empty($orderItem['ConditionNote']['FieldValue']) ? 'not found' : $orderItem['ConditionNote']['FieldValue'], 'conditionSubtypeId' => $orderItem['ConditionSubtypeId']['FieldValue'], 'conditionId' => $orderItem['ConditionId']['FieldValue']));
                 }
             }
             //组装数据
             $inserOrder[] = array('order' => $order, 'orderExtension' => $orderExtension, 'orderUserInfo' => $orderUserInfo, 'orderDetail' => $orderDetail);
             //拦截逻辑,计算重量运费
             /**待实现**/
         }
         return $inserOrder;
     }
 }
开发者ID:ohjack,项目名称:newErp,代码行数:80,代码来源:amazonButt.action.php

示例15: addtaobao

 function addtaobao()
 {
     include_once "Vendor/taobao/TopSdk.php";
     $url = strtolower(get_post_value('url'));
     $url = 'http://item.taobao.com/item.htm?id=43980628011';
     echo $url . '<br/>';
     $it_id = getQuerystr($url, 'id');
     //获取id值
     $c = new TopClient();
     //在taobao/TopClient.php 文件中 xml 改成 json
     $c->appkey = "23096388";
     $c->secretKey = "2cf7057bf7d3901d068ce5a200f89f0d";
     $req = new ItemGetRequest();
     $req->setFields("num_iid,title,price,pic_url,change_prop,location,list_time,delist_time,num,desc,property_alias,props,props_name,detail_url,item_weight,item_size,change_prop,item_imgs,prop_imgs,nick");
     $req->setNumIid($it_id);
     $resp = $c->execute($req, "");
     $array = object_array($resp);
     $delist_time = $array['item']['delist_time'];
     $descs = $array['item']['desc'];
     $list_time = $array['item']['list_time'];
     $city = $array['item']['location']['city'];
     $state = $array['item']['location']['state'];
     $num = $array['item']['num'];
     $num_iid = $array['item']['num_iid'];
     $pic_url = $array['item']['pic_url'];
     $price = $array['item']['price'];
     $property_alias = $array['item']['property_alias'];
     $props = $array['item']['props'];
     $props_name = $array['item']['props_name'];
     $title = $array['item']['title'];
     $nick = $array['item']['nick'];
     $type0 = '';
     //颜色
     $type1 = '';
     //尺寸
     $type2 = '';
     //上市时间
     $typeArr = explode(';', $props_name);
     foreach ($typeArr as $arrays) {
         $array = explode(':', $arrays);
         if ($array[0] == '1627207') {
             $type0 .= $array[3] . "|";
         }
         if ($array[0] == '20509') {
             $type1 .= $array[3] . "|";
         }
         if ($array[0] == '8560225') {
             $type2 .= $array[3] . "|";
         }
     }
     $pattern = "/<[img|IMG].*?src=[\\'|\"](.*?(?:[\\.gif|\\.jpg]))[\\'|\"].*?[\\/]?>/";
     preg_match_all($pattern, $descs, $match);
     $imgsrc = '';
     //照片描述
     foreach ($match[1] as $v) {
         $imgsrc .= $v . "|";
     }
     if (substr($url, 0, 7) != 'http://') {
         $url = 'http://' . $url;
     }
     $product_url = null;
     if (substr($url, 0, 22) == 'http://item.taobao.com') {
         $taobao = new Taobao($url);
         $product_url = $taobao->getProductUrl();
         $data = $taobao->getData();
         $this->assign('product_url', $product_url);
         $this->assign('data', $data);
         $this->assign('title', $title);
         $this->assign('type0', $type0);
         $this->assign('type1', $type1);
         $this->assign('type2', $type2);
         $this->assign('type3', $type2);
         $this->assign('list_time', $list_time);
         $this->assign('delist_time', $delist_time);
         $this->assign('location', $city . '|' . $state);
         $this->assign('price', $price);
         $this->assign('nick', $nick);
         $this->assign('pic_url', $pic_url);
         $this->assign('imgsrc', $imgsrc);
     } else {
     }
     $upload = new Upload();
     $this->assign('upload', $upload->show());
 }
开发者ID:koery,项目名称:Vcanbuy,代码行数:84,代码来源:ProductsController.class.php


注:本文中的object_array函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。