|
@@ -74,259 +74,25 @@ class Aatest extends Start_Controller {
|
|
|
$this->load->_model("Model_job_getyuntuwaybillid","job_getyuntuwaybillid");
|
|
|
$this->load->_model("Model_hualei",'hualei');
|
|
|
$this->load->_model("Model_job_gethualeiwaybillid","job_gethualeiwaybillid");
|
|
|
+ $this->load->_model("Model_apiyyv1","apiyyv1");
|
|
|
+ $this->load->_model("Model_settingtest","settingtest");
|
|
|
}
|
|
|
|
|
|
|
|
|
//定义方法的调用规则 获取URI第二段值
|
|
|
public function _remap($arg,$arg_array)
|
|
|
{
|
|
|
- // $this->_notice();
|
|
|
- // die;
|
|
|
- // $list = explode(',',"14-36 Inch Water Wave Wigs HD Human Hair Lace Front And 5x5 Closure Wigs - 13x6 HD Lace / 30 / 180%");
|
|
|
- // echo "<pre>";
|
|
|
- // var_dump($list);
|
|
|
- die;
|
|
|
- // echo substr("FN0205389",0,1);
|
|
|
- // die;
|
|
|
- // echo "<pre>";
|
|
|
|
|
|
- // $url = "https://xxu7p0-3q.myshopify.com/admin/api/2022-10/orders/5907496796348/fulfillment_orders.json";
|
|
|
- // $headerA = array();
|
|
|
- // $headerA[] = "X-Shopify-Access-Token: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";
|
|
|
- // var_dump($url);
|
|
|
- // var_dump($headerA);
|
|
|
- // $ch = curl_init();
|
|
|
- // curl_setopt($ch, CURLOPT_URL, $url);
|
|
|
- // curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
|
|
- // curl_setopt($ch, CURLOPT_HTTPHEADER, $headerA);
|
|
|
- // curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
|
|
- // curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
|
|
|
- // $res = curl_exec($ch);
|
|
|
- // // 检查是否有错误发生
|
|
|
- // if(curl_errno($ch)) {
|
|
|
- // echo 'cURL error: ' . curl_error($ch);
|
|
|
- // }
|
|
|
- // curl_close($ch);
|
|
|
- // var_dump($res);
|
|
|
-
|
|
|
-
|
|
|
- // $post = [];
|
|
|
- // $post['shopify_yd_one'] = 1;
|
|
|
- // echo "<pre>";
|
|
|
-
|
|
|
- // $post['url'] = "https://xxu7p0-3q.myshopify.com/admin/api/2022-10/orders/5908299219132/fulfillment_orders.json";
|
|
|
- // $post['token'] = "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";
|
|
|
- // var_dump($post);
|
|
|
-
|
|
|
- // $ch = curl_init();
|
|
|
- // curl_setopt($ch,CURLOPT_URL,'https://edm.alipearl.net/soapapi.php');
|
|
|
- // curl_setopt($ch, CURLOPT_POST, 1);
|
|
|
- // curl_setopt($ch, CURLOPT_HEADER, 0);
|
|
|
- // curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
|
|
|
- // curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
|
|
|
- // curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1);
|
|
|
- // curl_setopt($ch, CURLOPT_POSTFIELDS,http_build_query($post));
|
|
|
- // curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
|
|
- // curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,1800000);
|
|
|
- // $res = curl_exec($ch);
|
|
|
+ $number = "Y-PF-50722-001";
|
|
|
|
|
|
- // var_dump($res);
|
|
|
- // die;
|
|
|
|
|
|
-
|
|
|
- $str = '{"fulfillment":{"notify_customer":false,"tracking_info":{"number":"9210890251001300104198","company":"USPS"},"line_items_by_fulfillment_order":[{"fulfillment_order_id":"7008714555580"}]}}';
|
|
|
-
|
|
|
- $data = [
|
|
|
- 'token'=>'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',
|
|
|
- 'shopify_yd_two'=>1,
|
|
|
- 'url'=>'https://xxu7p0-3q.myshopify.com/admin/api/2022-10/fulfillments.json',
|
|
|
- 'data'=>json_decode($str),
|
|
|
- ];
|
|
|
- $ch = curl_init();
|
|
|
- curl_setopt($ch,CURLOPT_URL,'https://edm.alipearl.net/soapapi.php');
|
|
|
- curl_setopt($ch, CURLOPT_POST, 1);
|
|
|
- curl_setopt($ch, CURLOPT_HEADER, 0);
|
|
|
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
|
|
|
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
|
|
|
- curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1);
|
|
|
- curl_setopt($ch, CURLOPT_POSTFIELDS,http_build_query($data));
|
|
|
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
|
|
- curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,1800000);
|
|
|
- $res = curl_exec($ch);
|
|
|
- var_dump($res);
|
|
|
- die;
|
|
|
+ $this->apiyyv1->xcDcdByOtherId($number,$this->getToken(130));
|
|
|
|
|
|
-
|
|
|
- //7007609290940
|
|
|
- $url = "https://xxu7p0-3q.myshopify.com/admin/api/2022-10/fulfillments.json";
|
|
|
- $str = '{"fulfillment":{"notify_customer":false,"tracking_info":{"number":"9205590251001300110738","company":"USPS"},"line_items_by_fulfillment_order":[{"fulfillment_order_id":"7007609290940"}]}}';
|
|
|
-
|
|
|
-
|
|
|
- $data = [
|
|
|
- 'token'=>'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',
|
|
|
- 'shopify_yd_two'=>1,
|
|
|
- 'url'=>'https://xxu7p0-3q.myshopify.com/admin/api/2022-10/fulfillments.json',
|
|
|
- 'data'=>json_decode($str),
|
|
|
- ];
|
|
|
- echo "<pre>";
|
|
|
- print_r(json_encode($data)) ;
|
|
|
-
|
|
|
- die;
|
|
|
-
|
|
|
-
|
|
|
|
|
|
- $header = array();
|
|
|
- $header[] = "Content-Type: application/json";
|
|
|
- $header[] = "X-Shopify-Access-Token: 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";
|
|
|
- $ch = curl_init();
|
|
|
- curl_setopt($ch, CURLOPT_URL, $url);
|
|
|
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
|
|
- curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
|
|
|
- curl_setopt($ch, CURLINFO_HEADER_OUT, true);
|
|
|
- curl_setopt($ch, CURLOPT_POST, true);
|
|
|
- curl_setopt($ch, CURLOPT_POSTFIELDS, $str);
|
|
|
-
|
|
|
- // ========== 关键修复设置 ==========
|
|
|
- // 1. 强制使用 TLS 1.2(Shopify 要求)
|
|
|
- curl_setopt($ch, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1_2);
|
|
|
-
|
|
|
- // 2. 启用 DNS 缓存(避免 DNS 解析问题)
|
|
|
- curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
|
|
|
-
|
|
|
- // 3. 修复 Keep-Alive 问题
|
|
|
- curl_setopt($ch, CURLOPT_TCP_KEEPALIVE, 1);
|
|
|
- curl_setopt($ch, CURLOPT_TCP_KEEPIDLE, 10);
|
|
|
- curl_setopt($ch, CURLOPT_TCP_KEEPINTVL, 10);
|
|
|
-
|
|
|
- // 4. 连接超时设置(毫秒)
|
|
|
- curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
|
|
|
- curl_setopt($ch, CURLOPT_TIMEOUT, 60);
|
|
|
-
|
|
|
- // 5. 调试信息捕获(关键)
|
|
|
- curl_setopt($ch, CURLOPT_VERBOSE, true);
|
|
|
- $verbose = fopen('php://temp', 'w+');
|
|
|
- curl_setopt($ch, CURLOPT_STDERR, $verbose);
|
|
|
-
|
|
|
- // 6. 确保正确解析 SNI(服务器名称指示)
|
|
|
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
|
|
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
|
|
|
- // ================================
|
|
|
-
|
|
|
- $res = curl_exec($ch);
|
|
|
-
|
|
|
- // 错误处理增强
|
|
|
- if (curl_errno($ch)) {
|
|
|
- $error = curl_error($ch);
|
|
|
- $errno = curl_errno($ch);
|
|
|
-
|
|
|
- // 获取详细调试信息
|
|
|
- rewind($verbose);
|
|
|
- $verboseLog = stream_get_contents($verbose);
|
|
|
-
|
|
|
- echo "cURL 错误 ($errno): $error\n";
|
|
|
- echo "详细调试信息:\n" . $verboseLog . "\n";
|
|
|
-
|
|
|
- // 获取更多连接信息
|
|
|
- $info = curl_getinfo($ch);
|
|
|
- echo "连接信息:\n";
|
|
|
- print_r([
|
|
|
- 'http_code' => $info['http_code'] ?? null,
|
|
|
- 'primary_ip' => $info['primary_ip'] ?? null,
|
|
|
- 'primary_port' => $info['primary_port'] ?? null,
|
|
|
- 'local_ip' => $info['local_ip'] ?? null,
|
|
|
- 'local_port' => $info['local_port'] ?? null
|
|
|
- ]);
|
|
|
- } else {
|
|
|
- // 成功时获取请求头信息
|
|
|
- $sentHeaders = curl_getinfo($ch, CURLINFO_HEADER_OUT);
|
|
|
- echo "发送的请求头:\n$sentHeaders\n";
|
|
|
- }
|
|
|
-
|
|
|
- curl_close($ch);
|
|
|
- echo $res;
|
|
|
- die;
|
|
|
|
|
|
- // die;
|
|
|
- // $url = "https://xxu7p0-3q.myshopify.com/admin/api/2025-07/orders/5908608483516/fulfillments.json";
|
|
|
- // $headerA[] = "X-Shopify-Access-Token: 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";
|
|
|
- // $ch = curl_init();
|
|
|
- // curl_setopt($ch, CURLOPT_URL, $url);
|
|
|
- // curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
|
|
- // curl_setopt($ch, CURLOPT_HTTPHEADER, $headerA);
|
|
|
- // curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
|
|
- // curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
|
|
|
- // $res = curl_exec($ch);
|
|
|
- // $headerA = curl_getinfo($ch);
|
|
|
- // echo "<pre>";
|
|
|
- // var_dump($res);
|
|
|
- // die;
|
|
|
- $str = '{
|
|
|
- "fulfillment": {
|
|
|
- "notify_customer": false,
|
|
|
- "tracking_info": {
|
|
|
- "number": "9210890251001300104181",
|
|
|
- "company": "USPS"
|
|
|
- },
|
|
|
- "line_items_by_fulfillment_order": [
|
|
|
-
|
|
|
- ]
|
|
|
- }
|
|
|
- }';
|
|
|
|
|
|
- $arr = json_decode($str,true);
|
|
|
- $arr['fulfillment']['line_items_by_fulfillment_order'] = [
|
|
|
- ['fulfillment_order_id'=>'7009089323196']
|
|
|
- ];
|
|
|
- echo json_encode($arr);
|
|
|
- die;
|
|
|
- // $url = 'https://xxu7p0-3q.myshopify.com/admin/api/2022-10/fulfillments.json';
|
|
|
|
|
|
- // $header[] = "Content-Type: application/json";
|
|
|
- // $header[] = "X-Shopify-Access-Token: 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";
|
|
|
-
|
|
|
- // $ch = curl_init();
|
|
|
- // curl_setopt($ch, CURLOPT_URL, $url);
|
|
|
- // curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
|
|
- // curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
|
|
|
- // curl_setopt($ch, CURLINFO_HEADER_OUT, TRUE);
|
|
|
- // curl_setopt($ch, CURLOPT_POST, 1);
|
|
|
- // curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($arr));
|
|
|
- // curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
|
|
- // curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
|
|
|
- // $res = curl_exec($ch);
|
|
|
- // echo "<pre>";
|
|
|
- // var_dump($res);
|
|
|
- // die;
|
|
|
- $str = '{
|
|
|
- "fulfillment": {
|
|
|
- "notify_customer": false,
|
|
|
- "tracking_info": {
|
|
|
- "number": "9210890251001300104181",
|
|
|
- "company": "USPS"
|
|
|
- },
|
|
|
- "line_items_by_fulfillment_order": [
|
|
|
-
|
|
|
- ]
|
|
|
- }
|
|
|
- }';
|
|
|
-
|
|
|
- $arr = json_decode($str,true);
|
|
|
- $arr['fulfillment']['line_items_by_fulfillment_order'] = [
|
|
|
- 'fulfillment_order_id'=>'5908608483516'
|
|
|
- ];
|
|
|
-
|
|
|
- echo "<pre>";
|
|
|
- print_r(json_encode($arr));
|
|
|
die;
|
|
|
- $ddh = "5908608483516";
|
|
|
- $ydh = "9210890251001300104181";
|
|
|
- $xg = $this->fullorder->read(1266262);
|
|
|
- $shop = $this->shop->read($xg['shop']);
|
|
|
- $ex = $this->express->read($xg['express']);
|
|
|
- $remark = "";
|
|
|
- $shopifyid = "";
|
|
|
- $gx = $this->api->get_gx($ddh,$ydh,$xg,$shop,$ex,$remark,$shopifyid);
|
|
|
-
|
|
|
// $shopname = "yolissahair";
|
|
|
// if(in_array($shopname,['alipearlstore','finsahair','baddiebeautyshop','yolissahair'])){
|
|
|
// var_dump(true);
|
|
@@ -498,6 +264,12 @@ class Aatest extends Start_Controller {
|
|
|
//$this->job_get3pewaybillid->do_job();
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ public function getToken($type){
|
|
|
+ $name = "get_yytoken_".$type;
|
|
|
+ $token = $this->settingtest->$name();
|
|
|
+ return $token;
|
|
|
+ }
|
|
|
public function _notice(){
|
|
|
$notice = $this->notice->read(30);
|
|
|
$v = $this->fullorder->get_number('Y-50728-010');
|