|
@@ -487,16 +487,15 @@ class Aatest extends Start_Controller {
|
|
|
$user = $this->user->read(10);
|
|
|
|
|
|
$post = $this->ll();
|
|
|
-
|
|
|
if(isset($post['shop']))
|
|
|
{
|
|
|
- $fpcount = ['fpcount'];
|
|
|
+ $fpcount = $post['fpcount'];
|
|
|
if(!$fpcount)
|
|
|
{
|
|
|
echo json_encode(array('msg'=>'需要先清理浏览器缓存,刷新当前页面后再试!','success'=>false));exit;
|
|
|
}
|
|
|
- $customerid = ['customerid'];
|
|
|
- $shop = ['shop'];
|
|
|
+ $customerid = $post['customerid'];
|
|
|
+ $shop = $post['shop'];
|
|
|
$sp = $this->shop->read($shop);
|
|
|
$num = $this->fullorder->find_count('shop = "'.$sp['id'].'" and gtime = "'.date('Ymd',time()).'"');
|
|
|
$post['source'] = 1;//订单类型:1.线下订单2.PC3.手机
|
|
@@ -511,7 +510,7 @@ class Aatest extends Start_Controller {
|
|
|
{
|
|
|
$post['librarynot'] = "订单未打印,未审核或未通过";//不能出库原因
|
|
|
}
|
|
|
- $orderinfo = ['orderinfo'];
|
|
|
+ $orderinfo = $post['orderinfo'];
|
|
|
$post['shop'] = $sp['id'];
|
|
|
$post['user'] = $sp['shopuser'];
|
|
|
$post['number'] = $sp['shortname'].'-'.substr(date('ymd',time()),1).'-'.(substr(strval($num+1+1000),1,3));//编号
|
|
@@ -539,67 +538,67 @@ class Aatest extends Start_Controller {
|
|
|
echo json_encode(array('msg'=>'此交易号的订单已存在!','success'=>false));exit;
|
|
|
}
|
|
|
}
|
|
|
- $post['client'] = ['client'];//客户名称
|
|
|
- $btime = ['buytime'];//付款时间
|
|
|
+ $post['client'] = $post['client'];//客户名称
|
|
|
+ $btime = $post['buytime'];//付款时间
|
|
|
$post['buytime'] = strtotime($btime);//时间转UX
|
|
|
$post['dtime'] = time();//订单时间
|
|
|
$post['gtime'] = date('Ymd',time());//格式化时间
|
|
|
- $post['pay'] = ['pay'];//支付方式
|
|
|
- $post['capital'] = ['capital'];//资金状态
|
|
|
- $post['type'] = ['warehouse'];//发货仓库
|
|
|
- $post['currency'] = ['currency'];//币种
|
|
|
+ $post['pay'] = $post['pay'];//支付方式
|
|
|
+ $post['capital'] = $post['capital'];//资金状态
|
|
|
+ $post['type'] = $post['warehouse'];//发货仓库
|
|
|
+ $post['currency'] = $post['currency'];//币种
|
|
|
$currency = $this->typeclass->read($post['currency']);
|
|
|
$post['currencytitle'] = $currency['title'];//币种名称
|
|
|
- $post['freight'] = ['freight'];//运费
|
|
|
- $post['expressmoney'] = ['expressmoney'];//物流金额
|
|
|
- $post['shouldmoney'] = ['shouldmoney'];//应收金额
|
|
|
+ $post['freight'] = $post['freight'];//运费
|
|
|
+ $post['expressmoney'] = $post['expressmoney'];//物流金额
|
|
|
+ $post['shouldmoney'] = $post['shouldmoney'];//应收金额
|
|
|
$post['skje'] = $post['shouldmoney'];//收款金额
|
|
|
- $product = ['product'];//产品名称
|
|
|
+ $product = $post['product');//产品名称
|
|
|
$product = str_replace(array('%26','%2B'),array('&','+'),$product);
|
|
|
$post['product'] = preg_replace('/( | | |\s)/',' ',$product);
|
|
|
- $orderremarks = ['orderremarks'];//订单备注
|
|
|
+ $orderremarks = $post['orderremarks');//订单备注
|
|
|
$orderremarks = str_replace(array('%26','%2B'),array('&','+'),$orderremarks);
|
|
|
$post['orderremarks'] = preg_replace('/( | | |\s)/',' ',$orderremarks);
|
|
|
- $shipremarks = ['shipremarks'];//仓库品名
|
|
|
+ $shipremarks = $post['shipremarks');//仓库品名
|
|
|
$shipremarks = str_replace(array('%26','%2B'),array('&','+'),$shipremarks);//仓库品名
|
|
|
$post['shipremarks'] = preg_replace('/( | | |\s)/',' ',$shipremarks);
|
|
|
- $post['email'] = ['email'];//邮箱
|
|
|
- $name = ['name'];//名称
|
|
|
+ $post['email'] = $post['email'];//邮箱
|
|
|
+ $name = $post['name'];//名称
|
|
|
$post['name'] = preg_replace('/( | | |\s)/',' ',$name);
|
|
|
- $post['phone'] = ['phone'];//电话
|
|
|
+ $post['phone'] = $post['phone'];//电话
|
|
|
$post['phone'] = preg_replace('/\D/s','',$post['phone']);
|
|
|
- $post['country'] = ['country'];//国家
|
|
|
+ $post['country'] = $post['country'];//国家
|
|
|
$ct = $this->country->read($post['country']);//国家
|
|
|
$post['al'] = $ct['lb'];//国家二字码
|
|
|
- $post['province'] = ['province'];//省、州
|
|
|
+ $post['province'] = $post['province'];//省、州
|
|
|
$post['province'] = preg_replace("/^[\s\v".chr(227).chr(128)."]+/","", $post['province']); //替换开头空字符
|
|
|
$post['province'] = preg_replace("/[\s\v".chr(227).chr(128)."]+$/","", $post['province']); //替换结尾空字符
|
|
|
- $post['city'] = ['city'];//城市
|
|
|
+ $post['city'] = $post['city'];//城市
|
|
|
$post['city'] = preg_replace("/^[\s\v".chr(227).chr(128)."]+/","", $post['city']); //替换开头空字符
|
|
|
$post['city'] = preg_replace("/[\s\v".chr(227).chr(128)."]+$/","", $post['city']); //替换结尾空字符
|
|
|
- $post['zipcode'] = ['zipcode'];//邮编
|
|
|
+ $post['zipcode'] = $post['zipcode'];//邮编
|
|
|
$post['zipcode'] = preg_replace("/^[\s\v".chr(227).chr(128)."]+/","", $post['zipcode']); //替换开头空字符
|
|
|
$post['zipcode'] = preg_replace("/[\s\v".chr(227).chr(128)."]+$/","", $post['zipcode']); //替换结尾空字符
|
|
|
- $post['address'] = ['address'];//地址
|
|
|
- $post['printtype'] = ['printtype'];//打印类型
|
|
|
- $fpdata = ['fpdata'];//购买产品内容
|
|
|
+ $post['address'] = $post['address'];//地址
|
|
|
+ $post['printtype'] = $post['printtype'];//打印类型
|
|
|
+ $fpdata = $post['fpdata');//购买产品内容
|
|
|
$fpdata = str_replace(array('%26','%2B'),array('&','+'),$fpdata);
|
|
|
$post['fpdata'] = $fpdata;
|
|
|
- $post['sbpm'] = ['sbpm'];//申报品名
|
|
|
- $post['zwpm'] = ['zwpm'];//中文品名
|
|
|
- $post['ts'] = ['ts'];//条数
|
|
|
- $post['dtsbjz'] = ['dtsbjz'];//单条申报价
|
|
|
- $post['zsbjz'] = ['zsbjz'];//总申报价
|
|
|
- $post['zzl'] = ['zzl'];//总重量
|
|
|
- $post['zjs'] = ['zjs'];//总件数
|
|
|
- $post['express'] = ['express'];//快递公司
|
|
|
- $post['printtype'] = ['printtype'];//打印类型
|
|
|
- $post['quantity'] = ['quantity'];//数量
|
|
|
- $post['paypal'] = ['paypal'];//支付号
|
|
|
- $post['guarantee'] = ['guarantee'];//卖家保障
|
|
|
- $post['msg'] = ['msg'];//发送留言类型
|
|
|
- $post['ioss'] = ['ioss'];
|
|
|
- $post['sbpm'] = ['sbpm'];
|
|
|
+ $post['sbpm'] = $post['sbpm'];//申报品名
|
|
|
+ $post['zwpm'] = $post['zwpm'];//中文品名
|
|
|
+ $post['ts'] = $post['ts'];//条数
|
|
|
+ $post['dtsbjz'] = $post['dtsbjz'];//单条申报价
|
|
|
+ $post['zsbjz'] = $post['zsbjz'];//总申报价
|
|
|
+ $post['zzl'] = $post['zzl'];//总重量
|
|
|
+ $post['zjs'] = $post['zjs'];//总件数
|
|
|
+ $post['express'] = $post['express'];//快递公司
|
|
|
+ $post['printtype'] = $post['printtype'];//打印类型
|
|
|
+ $post['quantity'] = $post['quantity'];//数量
|
|
|
+ $post['paypal'] = $post['paypal'];//支付号
|
|
|
+ $post['guarantee'] = $post['guarantee'];//卖家保障
|
|
|
+ $post['msg'] = $post['msg'];//发送留言类型
|
|
|
+ $post['ioss'] = $post['ioss'];
|
|
|
+ $post['sbpm'] = $post['sbpm'];
|
|
|
$pay = $this->pay->get_typeclass($post['pay']);
|
|
|
$yga = $post['shouldmoney'];
|
|
|
$post['budget'] = 0;
|
|
@@ -623,8 +622,8 @@ class Aatest extends Start_Controller {
|
|
|
$post['budget'] = eval("return $yga*1.$ygb;");//预估到帐金额
|
|
|
}
|
|
|
}
|
|
|
- $baddress = ['baddress'];
|
|
|
- $saddress = ['saddress'];
|
|
|
+ $baddress = $post['baddress'];
|
|
|
+ $saddress = $post['saddress'];
|
|
|
$baddress = array_reverse(explode(',',$baddress));
|
|
|
$saddress = array_reverse(explode(',',$saddress));
|
|
|
$bar = '';$sar = '';
|
|
@@ -643,7 +642,7 @@ class Aatest extends Start_Controller {
|
|
|
}
|
|
|
$post['baddress'] = rtrim($bar,',');//卖家保障
|
|
|
$post['saddress'] = rtrim($sar,',');//卖家保障
|
|
|
- $whlabel = ['whlabel'];
|
|
|
+ $whlabel = $post['whlabel'];
|
|
|
if($post['express'] == 2 && (stripos($post['name'],'&') !== false || stripos($post['name'],"'") !== false))
|
|
|
{
|
|
|
echo json_encode(array('msg'=>'USPS收件人或公司名不可用特殊符号!','success'=>false));exit;
|
|
@@ -795,15 +794,14 @@ class Aatest extends Start_Controller {
|
|
|
$post['jweight'] = $this->weight->get_weightcx($post['fpdata']);
|
|
|
//查询净重结束
|
|
|
$cusnum = $this->customer->read($customerid);
|
|
|
- echo "<pre>";
|
|
|
- var_dump(array('num'=>$cusnum['num']+1,'time'=>$post['buytime']),$customerid);
|
|
|
- var_dump($post);
|
|
|
// $this->customer->save(array('num'=>$cusnum['num']+1,'time'=>$post['buytime']),$customerid);
|
|
|
// $this->fullorder->insert($post);
|
|
|
echo json_encode(array('msg'=>'下单成功','success'=>true));exit;
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
echo "1";
|
|
|
- die;
|
|
|
+ die;
|
|
|
}
|
|
|
|
|
|
|