panlumeng 3 years ago
parent
commit
1b357ab6ef
2 changed files with 6 additions and 17 deletions
  1. 2 1
      app/admin/controller/Customer.php
  2. 4 16
      app/admin/controller/Sale.php

+ 2 - 1
app/admin/controller/Customer.php

@@ -50,8 +50,9 @@ class Customer extends BaseController
                 $where[]=['itemid','=',$pid];
             }
         }
+        //->column("id,pid,name,level,depart_link");
         $itm = Db::name('customer_info')->where($where)->select();
-        $list = Db::name('customer_org1')->where($condition)->page($page,$size)->column("id,pid,name,level,depart_link");
+        $list = Db::name('customer_org1')->where($condition)->page($page,$size)->select();
 //        $data=[];
 //        foreach ($list as $item) {
 //            $cuost = Db::name('customer_info')->where(['itemid'=>$item['id'],'is_del'=>0])->find();

+ 4 - 16
app/admin/controller/Sale.php

@@ -253,26 +253,18 @@ public function info(){
     if($id==""){
         return error_show(1002,"参数id不能为空");
     }
- //  $wsm_code = isset($this->post['wsm_code']) && $this->post['wsm_code'] !=="" ? trim($this->post['wsm_code']) :"";
-//    if($wsm_code==""){
-//        return error_show(1003,"仓库code不能存在");
-//    }
-    $einfo = Db::name('sale')->where(['id'=>$id,'is_del'=>0])->field('good_code,good_name,customer_code,orderCode')->find();
+    $einfo = Db::name('sale')->where(['id'=>$id,'is_del'=>0])->field('good_code,good_name,good_num,customer_code,orderCode')->find();
     if(empty($einfo)){
         return error_show(1002,"未找到销售订单数据");
     }
-    $stok= Db::name('good_stock')->where(['id'=>$id,'is_del'=>0])->field('wsm_code')->find();
-    if(empty($stok)){
-        return error_show(0,"未找到商品数据");
-    }
     $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(['id'=>$einfo['orderCode']])->field('wsm_code,num,sale_price')->select();
-    $stok['temp']=$st;
+    $st = Db::name('sale_info')->where(['orderCode'=>$einfo['orderCode']])->field('wsm_code,num,sale_price,stock_id,wsm_code')->select();
     $einfo['item']=$fo;
+    $einfo['iten']=$st;
     if(empty($einfo)){
         return error_show(1002,"未找到销售订单数据");
     }else{
-        return app_show(0,"获取成功",[$einfo,$stok]);
+        return app_show(0,"获取成功",$einfo);
     }
 }
 public function del(){
@@ -356,10 +348,6 @@ public function fee(){
 }
 public function out(){
     $token= isset($this->post['token']) && $this->post['token'] !=="" ? trim($this->post['token']) :"";
-//    $orderCode= isset($this->post['orderCode']) && $this->post['orderCode'] !=="" ? trim($this->post['orderCode']) :"";
-//    if($orderCode==""){
-//        return error_show(1002,"参数orderCode不能为空");
-//    }
     $orderCode=makeNo("CK");
     $outCode = isset($this->post['outCode']) && $this->post['outCode'] !=="" ? trim($this->post['outCode']) :"";
     if($outCode==""){