瀏覽代碼

两个退货工单加字段

wufeng 2 年之前
父節點
當前提交
46a0aa2f77
共有 2 個文件被更改,包括 14 次插入12 次删除
  1. 7 6
      app/admin/controller/AfterChild.php
  2. 7 6
      app/admin/controller/ReorderChild.php

+ 7 - 6
app/admin/controller/AfterChild.php

@@ -14,28 +14,29 @@ class AfterChild extends Base
     public function getList()
     {
 
-        $param = $this->request->only(['page' => 1, 'size' => 10, 'returnCode' => '', 'status' => '', 'orderCode' => '', 'outCode' => ''], 'post', 'trim');
+        $param = $this->request->only(['page' => 1, 'size' => 10, 'returnCode' => '', 'status' => '', 'orderCode' => '', 'outCode' => '', 'order_type' => ''], 'post', 'trim');
 
         $where = [['a.is_del', '=', 0]];
         if ($param['returnCode'] != '') $where[] = ['a.returnCode', 'like', '%' . $param['returnCode'] . '%'];
         if ($param['status'] !== '') $where[] = ['a.status', '=', $param['status']];
         if ($param['orderCode'] != '') $where[] = ['a.orderCode', 'like', '%' . $param['orderCode'] . '%'];
         if ($param['outCode'] != '') $where[] = ['a.outCode', 'like', '%' . $param['outCode'] . '%'];
+        if ($param['order_type'] !== '') $where[] = ['d.order_type', '=', $param['order_type']];
 
         $count = Db::name('order_return_child')
             ->alias('a')
             ->leftJoin('warehouse_info b', 'b.wsm_code=a.send_wsm_code')
             ->leftJoin('warehouse_info c', 'c.wsm_code=a.return_wsm_code')
-            ->leftJoin('order_return d','d.returnCode=a.returnCode and d.is_del=0')
+            ->leftJoin('order_return d', 'd.returnCode=a.returnCode and d.is_del=0')
             ->where($where)
             ->count('a.id');
 
         $list = Db::name('order_return_child')
             ->alias('a')
-            ->field('a.id,a.returnCode,a.orderCode,a.outCode,a.order_out_child_status,a.outChildCode,b.supplierName send_supplierName,b.supplierNo send_supplierNo,b.name send_wsm_name,a.send_wsm_code,b.contactor_name send_contactor_name,a.send_num,a.return_num,c.supplierName return_supplierName,c.supplierNo return_supplierNo,c.name return_wsm_name,a.return_wsm_code,c.contactor_name return_contactor_name,a.status,d.companyNo,d.companyName,d.customer_code,d.customer_name')
+            ->field('a.id,a.returnCode,a.orderCode,a.outCode,a.order_out_child_status,a.outChildCode,b.supplierName send_supplierName,b.supplierNo send_supplierNo,b.name send_wsm_name,a.send_wsm_code,b.contactor_name send_contactor_name,a.send_num,a.return_num,c.supplierName return_supplierName,c.supplierNo return_supplierNo,c.name return_wsm_name,a.return_wsm_code,c.contactor_name return_contactor_name,a.status,d.companyNo,d.companyName,d.customer_code,d.customer_name,d.order_type')
             ->leftJoin('warehouse_info b', 'b.wsm_code=a.send_wsm_code')
             ->leftJoin('warehouse_info c', 'c.wsm_code=a.return_wsm_code')
-            ->leftJoin('order_return d','d.returnCode=a.returnCode and d.is_del=0')
+            ->leftJoin('order_return d', 'd.returnCode=a.returnCode and d.is_del=0')
             ->where($where)
             ->order(['a.addtime' => 'desc', 'a.id' => 'desc'])
             ->page($param['page'], $param['size'])
@@ -87,7 +88,7 @@ class AfterChild extends Base
             ->where(['is_del' => 0, 'wsm_code' => array_unique(array_merge(array_column($order_out_child, 'wsm_code'), array_column($param['list'], 'return_wsm_code')))])
             ->column('id', 'wsm_code');
 
-        if(array_sum(array_column($param['list'],'return_num')) != $info['error_num']) return json_show(1004,'数量错误');
+        if (array_sum(array_column($param['list'], 'return_num')) != $info['error_num']) return json_show(1004, '数量错误');
 
         Db::startTrans();
         try {
@@ -544,7 +545,7 @@ class AfterChild extends Base
             ->field('a.*,b.supplierName send_supplierName,b.supplierNo send_supplierNo,b.name send_wsm_name,c.supplierName return_supplierName,c.supplierNo return_supplierNo,c.name return_wsm_name,d.companyNo,d.companyName,d.customer_code,d.customer_name')
             ->leftJoin('warehouse_info b', 'b.wsm_code=a.send_wsm_code')
             ->leftJoin('warehouse_info c', 'c.wsm_code=a.return_wsm_code')
-            ->leftJoin('order_return d','d.returnCode=a.returnCode and d.is_del=0')
+            ->leftJoin('order_return d', 'd.returnCode=a.returnCode and d.is_del=0')
             ->where(['a.is_del' => 0, 'a.id' => $param['id']])
             ->findOrEmpty();
 

+ 7 - 6
app/admin/controller/ReorderChild.php

@@ -117,7 +117,7 @@ class ReorderChild extends Base
     public function getList()
     {
 
-        $param = $this->request->only(['page' => 1, 'size' => 10, 'returnCode' => '', 'status' => '', 'orderCode' => '', 'outCode' => '', 'outChildCode' => '', 'saleReturnChildCode' => ''], 'post', 'trim');
+        $param = $this->request->only(['page' => 1, 'size' => 10, 'returnCode' => '', 'status' => '', 'orderCode' => '', 'outCode' => '', 'outChildCode' => '', 'saleReturnChildCode' => '', 'order_type' => ''], 'post', 'trim');
 
         $where = [['a.is_del', '=', 0]];
         if ($param['returnCode'] != '') $where[] = ['a.returnCode', 'like', '%' . $param['returnCode'] . '%'];
@@ -126,18 +126,19 @@ class ReorderChild extends Base
         if ($param['outCode'] != '') $where[] = ['a.outCode', 'like', '%' . $param['outCode'] . '%'];
         if ($param['outChildCode'] != '') $where[] = ['a.outChildCode', 'like', '%' . $param['outChildCode'] . '%'];
         if ($param['saleReturnChildCode'] != '') $where[] = ['a.saleReturnChildCode', 'like', '%' . $param['saleReturnChildCode'] . '%'];
+        if ($param['order_type'] !== '') $where[] = ['b.order_type', '=', $param['order_type']];
 
         $count = Db::name('sale_return_child')
             ->alias('a')
-            ->leftJoin('sale_return b','b.returnCode=a.returnCode and b.is_del=0')
-            ->leftJoin('warehouse_info c','c.wsm_code=a.return_wsm_code and c.is_del=0') ->where($where)
+            ->leftJoin('sale_return b', 'b.returnCode=a.returnCode and b.is_del=0')
+            ->leftJoin('warehouse_info c', 'c.wsm_code=a.return_wsm_code and c.is_del=0')->where($where)
             ->count('a.id');
 
         $list = Db::name('sale_return_child')
             ->alias('a')
-            ->field('a.id,a.saleReturnChildCode,a.type,a.outChildCode,a.outCode,a.companyNo,a.companyName,a.customer_code,a.customerName,a.num,a.sale_price,a.total_price,a.status,a.addtime,b.supplierNo,b.supplierName,a.return_wsm_code,c.name return_wsm_name')
-            ->leftJoin('sale_return b','b.returnCode=a.returnCode and b.is_del=0')
-            ->leftJoin('warehouse_info c','c.wsm_code=a.return_wsm_code and c.is_del=0')
+            ->field('a.id,a.saleReturnChildCode,a.type,a.outChildCode,a.outCode,a.companyNo,a.companyName,a.customer_code,a.customerName,a.num,a.sale_price,a.total_price,a.status,a.addtime,b.supplierNo,b.supplierName,a.return_wsm_code,c.name return_wsm_name,c.supplierNo return_supplierNo,c.supplierName return_supplierName,c.contactor_name return_contactor_name,b.order_type')
+            ->leftJoin('sale_return b', 'b.returnCode=a.returnCode and b.is_del=0')
+            ->leftJoin('warehouse_info c', 'c.wsm_code=a.return_wsm_code and c.is_del=0')
             ->where($where)
             ->order(['a.addtime' => 'desc', 'a.id' => 'desc'])
             ->page($param['page'], $param['size'])