load->_model('Model_shop','shop'); $this->load->_model('Model_fullorder','fullorder'); $this->load->_model('Model_fullordertt','fullordertt'); $this->load->_model('Model_fullordersmt','fullordersmt'); $this->load->_model('Model_fullorder_2020','fullorder2020'); $this->load->_model('Model_fullordersmt_2020','fullordersmt2020'); $this->load->_model('Model_customersmt','customersmt'); $this->load->_model('Model_country','country'); $this->load->_model('Model_hl','hl'); $this->load->_model('Model_is','is'); $this->load->_model('Model_kdniao','kdniao'); $this->load->_model('Model_typeclass','typeclass'); $this->load->_model('Model_warehouse','warehouse'); $this->load->_model('Model_fullorderexcel','fullorderexcel'); $this->load->_model('Model_dhl','dhl'); $this->load->_model('Model_usps','usps'); $this->load->_model('Model_dhltest','dhltest'); $this->load->_model('Model_customer','customer'); $this->load->_model('Model_express','express'); $this->load->_model('Model_notice','notice'); $this->load->_model('Model_whlabel','whlabel'); $this->load->_model('Model_productdescribe','productdescribe'); $this->load->_model('Model_ljg','ljg'); $this->load->_model('Model_commodityread','commodityread'); $this->load->_model('Model_service','service'); $this->load->_model('Model_fedex','fedex'); $this->load->_model('Model_commodity','commodity'); $this->load->_model('Model_fullordersmtorder','fullordersmtorder'); $this->load->_model('Model_ali','ali'); $this->load->_model('Model_fullordersmthb','fullordersmthb'); $this->load->_model('Model_fullordersmtbf','fullordersmtbf'); $this->load->_model('Model_taxzhengzhou','taxzhengzhou'); $this->load->_model('Model_taxshanghai','taxshanghai'); $this->load->_model('Model_excel','excel'); $this->load->_model('Model_ups','ups'); $this->load->_model('Model_dpd','dpd'); $this->load->_model('Model_dpdold','dpdold'); $this->load->_model('Model_dpd_IOSS','dpd_IOSS'); $this->load->_model('Model_dpdxw','dpdxw'); $this->load->_model('Model_cne','cne'); $this->load->_model('Model_outbound','outbound'); $this->load->_model('Model_api','api'); $this->load->_model('Model_dhlhz','dhlhz'); $this->load->_model('Model_apismt','apismt'); $this->load->_model('Model_specialstock','specialstock'); $this->load->_model('Model_systemwigsout','systemwigsout'); $this->load->_model('Model_purchaseorder','purchaseorder'); $this->load->_model('Model_returns','returns'); $this->load->_model('Model_whlabellabel','whlabellabel'); $this->load->_model('Model_whlabelbarcode','whlabelbarcode'); $this->load->_model('Model_tjadd','tjadd'); $this->load->_model('Model_stafflist','stafflist'); $this->load->_model('Model_paypal','paypal'); $this->load->_model('Model_warehousefactory','warehousefactory'); $this->load->_model('Model_commodityread_del','commodityreaddel'); $this->load->_model('Model_als','als'); $this->load->_model('Model_allocation','allocation'); $this->load->_model('Model_17track','17track'); $this->load->_model('Model_hualei','hualei'); $this->load->_model('Model_ck','ck'); $this->load->_model('Model_colour','colour'); $this->load->_model('Model_color','color'); $this->load->_model('Model_emaildata','emaildata'); $this->load->_model('Model_wigprint','wigprint'); $this->load->_model('Model_weight','weight'); $this->load->_model('Model_whlabeltransport','whlabeltransport'); $this->load->_model('Model_pay','pay'); $this->load->_model('Model_orderurl','orderurl'); $this->load->_model('Model_classid','classid'); $this->load->_model('Model_apiyy','apiyy'); $this->load->_model('Model_purchase','purchase'); $this->load->_model('Model_apitt','apitt'); } //定义方法的调用规则 获取URI第二段值 public function _remap($arg,$arg_array) { if($arg == 'a') { $this->_a($arg_array); } else if($arg == 'b') { $this->_b($arg_array); } else if($arg == 'rk') { $this->_rk($arg_array); } else if($arg == 'dc') { $this->_dc($arg_array); } } public function _dc($arg_array) { $data = $this->fullorder->get_number($arg_array[0]); $classid = $this->classid->sku(); $tc = $this->typeclass->find_all(); $typeclass = array(); foreach ($tc as $v) { $tcjm[$v['id']] = array($v['jm'],$v['classid']); $typeclass[$v['id']] = array('zh'=>$v['zh'],'classid'=>$v['classid'],'bm'=>$v['bm'],'title'=>$v['title'],'jm'=>$v['jm']); } $bm = '03'; $xysc = array(); $data['lh'] = array(); $scid = '';$cw = '';$lc = 0; $sku = explode(';',trim($data['fpdata'],';')); $whlabelsc = explode('|',trim($data['whlabel'],'|')); $cs = array(); foreach($sku as $key=>$val) { $pm = $classid; $jm = $classid; $bmpx = array(13=>'',16=>'',18=>'',25=>'',26=>'',41=>''); $features = str_replace(array('-163-','-164-','-165-','-166-'),'-',$val); $ts = explode('|',trim($features,'|')); if(stripos($ts[0],',') !== false) { $ft = explode(',',$ts[0]); $features = explode('-',trim($ft[1],'-')); $features[] = $ft[0]; } else { $features = explode('-',trim($ts[0],'-')); } foreach($features as $k=>$v) { if(isset($typeclass[$v]) && isset($bmpx[$typeclass[$v]['classid']])) { if($typeclass[$v]['bm'] != '') { $bmpx[$typeclass[$v]['classid']] = $typeclass[$v]['bm']; } } if($v != 0) { if(isset($pm[$typeclass[$v]['classid']])) { if($typeclass[$v]['title'] == '9A') { $pm[$typeclass[$v]['classid']] = '9A'; } else if($typeclass[$v]['title'] == '10A') { $pm[$typeclass[$v]['classid']] = '10A'; } else { $clzh = $typeclass[$v]['zh']; if(stripos($typeclass[$v]['zh'],'|') !== false) { $clzh = explode('|',rtrim($typeclass[$v]['zh'],'|')); $clzh = $clzh[0]; } $pm[$typeclass[$v]['classid']] = $clzh; } } if(isset($jm[$typeclass[$v]['classid']])) { if($typeclass[$v]['jm']) { $jm[$typeclass[$v]['classid']] = $typeclass[$v]['jm']; } } } } $cs[] = array($bmpx,$jm); $jm = array_filter($jm); $jm = implode("-",$jm); $pm = array_filter($pm);//去除空值 $zh = implode(" ",$pm); $zh = preg_replace("/\r\n|\r|\n/",'',trim($zh,' ')); $data['lh'][] = array('sku'=>$jm,'ts'=>$ts[2]); } echo "
"; print_r($cs); echo ""; print_r($sku); } public function _rk($arg_array) { $a = $this->fullorder->get_number($arg_array[0]); $classid = $this->classid->sku(); $tcall = $this->typeclass->find_all(); $apiyy = $a; $shop = $this->shop->read($a['shop']); @$ay = $this->apiyy->_order($apiyy,$classid,$tcall); echo ""; print_r($ay); echo ""; print_r($a); echo ""; print_r($shop); exit; } public function _b() { $data = $this->fullorder->get_number('Alipearl-70419-001'); echo ""; print_r($data); exit; $data = $this->fullorder->get_number('KISS-30929-094'); $data['dtime'] = time(); $classid = $this->classid->sku(); $tc = $this->typeclass->find_all(); $error = ''; $typeclass = array(); foreach ($tc as $v) { $tcjm[$v['id']] = array($v['jm'],$v['classid']); $typeclass[$v['id']] = array('zh'=>$v['zh'],'classid'=>$v['classid'],'bm'=>$v['bm'],'title'=>$v['title'],'jm'=>$v['jm']); } $pm = $classid; $jm = $classid; $bm = '03'; $bmpx = array(13=>'',16=>'',18=>'',25=>'',26=>'',41=>''); $data['lh'] = array();$sc = array(); $sku = explode(';',trim($data['fpdata'],';')); $whlabelsc = explode('|',trim($data['whlabel'],'|')); foreach($sku as $key=>$val) { $features = str_replace(array('-163-','-164-','-165-','-166-'),'-',$val); $ts = explode('|',trim($features,'|')); if(stripos($ts[0],',') !== false) { $ft = explode(',',$ts[0]); $features = explode('-',trim($ft[1],'-')); $features[] = $ft[0]; } else { $features = explode('-',trim($ts[0],'-')); } foreach($features as $k=>$v) { if(isset($typeclass[$v]) && isset($bmpx[$typeclass[$v]['classid']])) { if($typeclass[$v]['bm'] != '') { $bmpx[$typeclass[$v]['classid']] = $typeclass[$v]['bm']; } } if($v != 0) { if(isset($pm[$typeclass[$v]['classid']])) { if($typeclass[$v]['title'] == '9A') { $pm[$typeclass[$v]['classid']] = '9A'; } else if($typeclass[$v]['title'] == '10A') { $pm[$typeclass[$v]['classid']] = '10A'; } else { $clzh = $typeclass[$v]['zh']; if(stripos($typeclass[$v]['zh'],'|') !== false) { $clzh = explode('|',rtrim($typeclass[$v]['zh'],'|')); $clzh = $clzh[0]; } $pm[$typeclass[$v]['classid']] = $clzh; } } if(isset($jm[$typeclass[$v]['classid']])) { $jm[$typeclass[$v]['classid']] = $typeclass[$v]['jm']; } } } $jm = array_filter($jm);//去除空值 $pm = array_filter($pm);//去除空值 $zh = implode(" ",$pm); $zh = preg_replace("/\r\n|\r|\n/",'',trim($zh,' ')); $data['lh'][] = array('sku'=>implode("-",$jm),'ts'=>$ts[2]); $lh = $this->apiyy->get_cjlp(array('sku'=>implode("-",$jm),'title'=>$ts[1],'zh'=>$zh,'bm'=>$bm.implode("",$bmpx))); $sfsc = explode('-',$whlabelsc[$key]); if($sfsc[2] == 'DNOTO') { $sc[] = $this->apiyy->get_sc(array('sku'=>implode("-",$jm),'title'=>$ts[1],'id'=>$data['id'])); } } if($error) { return array('c'=>1,'error'=>$error,'lx'=>'料号','number'=>$data['number']);exit; } $a = $this->apiyy->get_order($data); if($a == 1) { return array('c'=>0);exit; } echo ""; print_r($a); echo ""; print_r($sc); echo ""; print_r($lh); echo ""; exit; } public function _bsd($arg_array) { exit; $post = $this->fullorder->get_number($arg_array[0]); $classid = $this->classid->sku(); $tcall = $this->typeclass->find_all(); $ay = $this->apiyy->_order($post,$classid,$tcall); if($ay['c'] == 1) { $this->apiyy->insert(array('number'=>$ay['number'],'lx'=>$ay['lx'],'error'=>$ay['error'])); } print_r($a); /** $a = $this->apiyy->get_cjlp(array('sku'=>'9A-#color25-wavy25-5*5Bob-14-180%-M','title'=>'Wigs 9A #color25 wavy25 5*5 Bob Wig Medium 180% 14inch ','zh'=>'9A 5*5波波头套 14寸 (180%密度) (中号)')); echo ""; print_r($a); exit; $tc = $this->typeclass->find_all(); $typeclass = array(); foreach ($tc as $v) { $this->typeclass->save(array('yzh'=>$v['zh']),$v['id']); } **/ exit; $s = $this->fullorder->get_number($arg_array[0]); $a = $this->apiyy->get_chd($s); echo ""; print_r($a); exit; } public function _a($arg_array) { $list["SqlString"] = "select a.id,a.code,c.name,a.org,b.name org_name from CBO_Wh a left join CBO_Wh_trl c on c.id=a.id left join Base_Organization_trl b on a.org=b.id"; $list = json_encode($list); $token = $this->setting->get_yytoken_101(); $url = 'http://172.31.105.167/U9C/webapi/QueryCommon/QueryInfoBySql'; $header[] = "Content-Type: application/json"; $header[] = "Token: ".$token; $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, $list); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); $res = curl_exec($ch); $res = json_decode($res,true); echo ""; print_r($res); exit; $tc = $this->typeclass->find_all(); $typeclass = array(); foreach ($tc as $v) { $tcjm[$v['id']] = array($v['jm'],$v['classid']); $typeclass[$v['id']] = array('zh'=>$v['zh'],'classid'=>$v['classid'],'bm'=>$v['bm'],'title'=>$v['title'],'jm'=>$v['jm']); } //$s = $this->fullorder->find_all('1=1','*','id desc',100,103); $s = $this->fullorder->get_number($arg_array[0]); $classid = $this->classid->sku(); $pm = $classid; $jm = $classid; $bm = '03'; $bmpx = array(13=>'',16=>'',18=>'',25=>'',26=>'',41=>''); $s['lh'] = array(); $sku = explode(';',trim($s['fpdata'],';')); foreach($sku as $val) { $features = str_replace(array('-163-','-164-','-165-','-166-'),'-',$val); $ts = explode('|',trim($features,'|')); if(stripos($ts[0],',') !== false) { $ft = explode(',',$ts[0]); $features = explode('-',trim($ft[1],'-')); $features[] = $ft[0]; } else { $features = explode('-',trim($ft[1],'-')); } foreach($features as $k=>$v) { if(isset($typeclass[$v]) && isset($bmpx[$typeclass[$v]['classid']])) { if($typeclass[$v]['bm'] != '') { $bmpx[$typeclass[$v]['classid']] = $typeclass[$v]['bm']; } } if($v != 0) { if(isset($pm[$typeclass[$v]['classid']])) { if($typeclass[$v]['title'] == '9A') { $pm[$typeclass[$v]['classid']] = '9A'; } else if($typeclass[$v]['title'] == '10A') { $pm[$typeclass[$v]['classid']] = '10A'; } else { $clzh = $typeclass[$v]['zh']; if(stripos($typeclass[$v]['zh'],'|') !== false) { $clzh = explode('|',rtrim($typeclass[$v]['zh'],'|')); $clzh = $clzh[0]; } $pm[$typeclass[$v]['classid']] = $clzh; } } if(isset($jm[$typeclass[$v]['classid']])) { $jm[$typeclass[$v]['classid']] = $typeclass[$v]['jm']; } } } $jm = array_filter($jm);//去除空值 $pm = array_filter($pm);//去除空值 $zh = implode(" ",$pm); $zh = preg_replace("/\r\n|\r|\n/",'',trim($zh,' ')); $s['lh'][] = array('sku'=>implode("-",$jm),'ts'=>$ts[2]); $lh = $this->apiyy->get_cjlp(array('sku'=>implode("-",$jm),'title'=>$ts[1],'zh'=>$zh,'bm'=>$bm.implode("",$bmpx))); if(!isset($lh['Data'][0]) || $lh['Data'][0]['m_isSucess'] != 1) { if($lh['Data'][0]['m_errorMsg'] == '料号 已存在,请重新输入!') { continue; } else { print_r($lh);exit; } } } $a = $this->apiyy->get_order($s); echo ""; print_r($a); echo ""; print_r(array('sku'=>implode("-",$jm),'title'=>$ts[1],'zh'=>$zh,'bm'=>$bm.implode("",$bmpx))); exit; } }