|
@@ -258,7 +258,7 @@ public function info(){
|
|
|
return error_show(1002,"未找到销售订单数据");
|
|
|
}
|
|
|
$fo = Db::name('order_addr')->where(['orderCode'=>$einfo['orderCode'],'is_del'=>0])->field('addr,contactor,mobile,receipt_quantity,arrive_time')->select();
|
|
|
- $st = Db::name('sale_info')->where(['orderCode'=>$einfo['orderCode']])->field('wsm_code,num,sale_price,stock_id,wsm_code')->select();
|
|
|
+ $st = Db::name('sale_info')->where(['orderCode'=>$einfo['orderCode']])->field('wsm_code,num,sale_price,wsm_code')->select();
|
|
|
$einfo['item']=$fo;
|
|
|
$einfo['iten']=$st;
|
|
|
if(empty($einfo)){
|
|
@@ -348,10 +348,10 @@ public function fee(){
|
|
|
}
|
|
|
public function out(){
|
|
|
$token= isset($this->post['token']) && $this->post['token'] !=="" ? trim($this->post['token']) :"";
|
|
|
- $orderCode=makeNo("CK");
|
|
|
- $outCode = isset($this->post['outCode']) && $this->post['outCode'] !=="" ? trim($this->post['outCode']) :"";
|
|
|
- if($outCode==""){
|
|
|
- return error_show(1002,"参数outcode不能为空");
|
|
|
+ $outCode=makeNo("CK");
|
|
|
+ $orderCode = isset($this->post['orderCode']) && $this->post['orderCode'] !=="" ? trim($this->post['orderCode']) :"";
|
|
|
+ if($orderCode==""){
|
|
|
+ return error_show(1002,"参数orderCode不能为空");
|
|
|
}
|
|
|
$post_name= isset($this->post['post_name']) && $this->post['post_name'] !=="" ? trim($this->post['post_name']) :"";
|
|
|
if($post_name==""){
|
|
@@ -363,7 +363,11 @@ public function out(){
|
|
|
}
|
|
|
$post_fee = isset($this->post['post_fee']) && $this->post['post_fee'] !=="" ? intval($this->post['post_fee']) :"";
|
|
|
if($post_fee==""){
|
|
|
- return error_show(1002,"物流费用不能为空");
|
|
|
+ return error_show(1002,"物流费不能为空");
|
|
|
+ }
|
|
|
+ $send_num = isset($this->post['send_num']) && $this->post['send_num'] !=="" ? $this->post['send_num'] :"";
|
|
|
+ if($send_num==""){
|
|
|
+ return error_show(1002,"发货数量不能为空");
|
|
|
}
|
|
|
$apply_id =GetUserInfo($token);
|
|
|
if(empty($apply_id)||$apply_id['code']!=0){
|
|
@@ -372,24 +376,30 @@ public function out(){
|
|
|
$rm= isset($apply_id["data"]['id']) ? $apply_id["data"]['id'] : "";
|
|
|
$ri= isset($apply_id["data"]['nickname']) ? $apply_id["data"]['nickname'] : "";
|
|
|
$addrid = isset($this->post['addrid']) && $this->post['addrid'] !=="" ? intval($this->post['addrid']) :"";
|
|
|
+ $dr = Db::name('order_addr')->where(['id'=>$addrid,'is_del'=>0])->find();
|
|
|
+ if(empty($dr)){
|
|
|
+ return error_show(1003,"收货人信息未找到");
|
|
|
+ }
|
|
|
+ if($dr['orderCode']!== $orderCode){
|
|
|
+ return error_show(1002,"订单code不存在");
|
|
|
+ }
|
|
|
$sendtime = isset($this->post['sendtime']) && $this->post['sendtime'] !=="" ? $this->post['sendtime']:date("Y-m-d H:i:s");
|
|
|
- $send_num = isset($this->post['send_num']) && $this->post['send_num'] !=="" ? $this->post['send_num'] :"";
|
|
|
- $check_num = isset($this->post['check_num']) && $this->post['check_num'] !=="" ? $this->post['check_num'] :"";
|
|
|
- $error_num = isset($this->post['error_num']) && $this->post['error_num'] !=="" ? $this->post['error_num'] :"";
|
|
|
- $status = isset($this->post['status']) && $this->post['status'] !=="" ? $this->post['status'] :"";
|
|
|
+// $check_num = isset($this->post['check_num']) && $this->post['check_num'] !=="" ? $this->post['check_num'] :"";
|
|
|
+// $error_num = isset($this->post['error_num']) && $this->post['error_num'] !=="" ? $this->post['error_num'] :"";
|
|
|
+ $status = isset($this->post['status']) && $this->post['status'] !=="" ? $this->post['status'] :"0";
|
|
|
$data=[
|
|
|
"orderCode"=>$orderCode,
|
|
|
"outCode"=>$outCode,
|
|
|
"apply_id"=>$rm,
|
|
|
"apply_name"=>$ri,
|
|
|
- "addrid"=>$addrid,
|
|
|
+ "addrid"=>$dr['id'],
|
|
|
"post_name"=>$post_name,
|
|
|
"post_code"=>$post_code,
|
|
|
"post_fee"=>$post_fee,
|
|
|
"sendtime"=>$sendtime,
|
|
|
"send_num"=>$send_num,
|
|
|
- "check_num"=>$check_num,
|
|
|
- "error_num"=>$error_num,
|
|
|
+ "check_num"=>0,
|
|
|
+ "error_num"=>0,
|
|
|
"status"=>$status,
|
|
|
"addtime"=>date("Y-m-d H:i:s"),
|
|
|
"updatetime"=>date("Y-m-d H:i:s")
|
|
@@ -402,15 +412,15 @@ public function out(){
|
|
|
}
|
|
|
}
|
|
|
public function customer(){
|
|
|
- $orderCode= isset($this->post['orderCode']) && $this->post['orderCode'] !=="" ? trim($this->post['orderCode']) :"";
|
|
|
- if(empty($orderCode)){
|
|
|
+ $outCode= isset($this->post['outCode']) && $this->post['outCode'] !=="" ? trim($this->post['outCode']) :"";
|
|
|
+ if(empty($outCode)){
|
|
|
return error_show(1002,"销售订单编号不能为空");
|
|
|
}
|
|
|
$status = isset($this->post['status']) && $this->post['status'] !== "" ? $this->post['status'] :"";
|
|
|
if($status==""){
|
|
|
return error_show(10002,"状态不能为空");
|
|
|
}
|
|
|
- $codeinfo = Db::name('order_out')->where(['orderCode'=>$orderCode])->find();
|
|
|
+ $codeinfo = Db::name('order_out')->where(['outCode'=>$outCode])->find();
|
|
|
if($codeinfo==""){
|
|
|
return error_show(1003,"未找到订单数据");
|
|
|
}
|
|
@@ -418,9 +428,9 @@ public function customer(){
|
|
|
$codeinfo['updatetime']=date("Y-m-d H:i:s");
|
|
|
$cust = Db::name('order_out')->save($codeinfo);
|
|
|
if($cust){
|
|
|
- return error_show(0,"销售订单更新成功");
|
|
|
+ return error_show(0,"出库订单更新成功");
|
|
|
}else{
|
|
|
- return error_show(1003,"销售订单更新失败");
|
|
|
+ return error_show(1003,"出库订单更新失败");
|
|
|
}
|
|
|
}
|
|
|
}
|