Browse Source

细节优化

wufeng 2 years ago
parent
commit
79b52941fe
2 changed files with 50 additions and 10 deletions
  1. 16 10
      app/admin/controller/OrderOutChild.php
  2. 34 0
      app/admin/route/app.php

+ 16 - 10
app/admin/controller/OrderOutChild.php

@@ -138,15 +138,15 @@ class OrderOutChild extends Base
             ->select()
             ->toArray();
 
-        $all_apply_id = array_column($list, 'apply_id');
-        $company_name = get_company_name_by_uid($all_apply_id);
+//        $all_apply_id = array_column($list, 'apply_id');
+//        $company_name = get_company_name_by_uid($all_apply_id);
 
         //校验是否开通了供应商账号
         $supp_account = checkHasAccountBySupplierNos(array_unique(array_column($list, 'supplierNo')));
 
         $data = [];
         foreach ($list as $value) {
-            $value['company_name'] = $company_name[$value['apply_id']] ?? '';
+//            $value['company_name'] = $company_name[$value['apply_id']] ?? '';
             $value['has_account'] = (int)isset($supp_account[$value['supplierNo']]);
             $data[] = $value;
         }
@@ -175,6 +175,7 @@ class OrderOutChild extends Base
             'apply_name' => '',
             'order_type' => '',
             'relaComNo' => '',
+            'use_type' => '',
         ], 'post', 'trim');
 
         $where = [['a.is_del', '=', 0]];
@@ -195,6 +196,7 @@ class OrderOutChild extends Base
         if ($param['apply_name'] != '') $where[] = ['a.apply_name', 'like', '%' . $param['apply_name'] . '%'];
         if ($param['order_type'] != '') $where[] = ['a.order_type', '=', $param['order_type']];
         if ($param['relaComNo'] != '') $where[] = ['a.companyNo', '=', $param['relaComNo']];
+        if ($param['use_type'] !== '') $where[] = ['p.use_type', '=', $param['use_type']];
 
         $condition = '';
         //只有level2的账号过滤数据权限
@@ -226,24 +228,28 @@ class OrderOutChild extends Base
 
         $list = Db::name('order_out_child')
             ->alias('a')
-            ->field('a.outChildCode 发货工单号,a.orderCode 确认单编号,a.outCode 发货申请单号,a.companyNo 业务公司编号,a.companyName 业务公司名称,a.customer_code 客户编号,a.customer_name 客户名称,a.supplierNo 供应商编号,a.supplierName 供应商名称,a.spuCode 商品成本编号,a.skuCode 商品上线编号,a.good_name 商品名称,case a.order_source when 1 then "直接下单" when 2 then "咨询" when 3 then "项目" when 4 then "平台" when 5 then "有赞" when 6 then "售后补换货" when 7 then "报备转单" when 8 then "支付渠道" end "订单来源",case order_type when 1 then "备库" when 2 then "非库存" when 3 then "咨询商品" when 4 then "报备商品" end "商品类型",a.num 数量,case a.status when 1 then "待发货" when 2 then "发货完成" when 3 then "已收货" when 4 then "已全部退货" end "分单状态",a.addtime 下单时间,a.apply_name 申请人名称,a.post_name 物流公司,a.post_code 物流单号,a.post_fee 物流费用')
+            ->field('a.outChildCode 发货工单号,a.outCode 发货单编号,a.orderCode 销售订单编号,"" 供应商端,case a.status when 1 then "待发货" when 2 then "发货完成" when 3 then "已收货" when 4 then "已全部退货" end "状态" ,case a.order_type when 1 then "备库" when 2 then "非库存" when 3 then "咨询商品" when 4 then "报备商品" end "商品类型",case a.order_source when 1 then "直接下单" when 2 then "咨询" when 3 then "项目" when 4 then "平台" when 5 then "有赞" when 6 then "售后补换货" when 7 then "报备转单" when 8 then "支付渠道" end "订单来源",a.num 总数量,a.wsm_code 仓库编号,c.name 仓库名称,a.spuCode 商品成本编码,a.skuCode 商品上线编码,a.companyNo 业务公司编号,a.companyName 业务公司名称,a.customer_code 客户编号,a.customer_name 客户名称,a.supplierNo 供应商编号,a.supplierName 供应商名称,a.addtime 下单时间,a.apply_name 申请人,case p.use_type when 0 then "无" when 1 then "to B" when 2 then "to C" end 对接类型')
+            ->leftJoin('warehouse_info c', 'c.wsm_code=a.wsm_code AND c.is_del=0')
+            ->leftJoin('sale d', 'd.orderCode=a.orderCode AND d.is_del=0')
+            ->leftJoin('platform p', 'p.id=d.platform_id AND p.is_del=0')
             ->order(['a.addtime' => 'desc', 'a.id' => 'desc'])
             ->where($where)
             ->where($condition)
             ->select()
             ->toArray();
 
+        //校验是否开通了供应商账号
+        $supp_account = checkHasAccountBySupplierNos(array_unique(array_column($list, '供应商编号')));
+
 //        $all_apply_id = array_column($list, 'apply_id');
 //        $company_name = get_company_name_by_uid($all_apply_id);
 
 //        $data = [];
-//        foreach ($list as &$value) {
-//
+        foreach ($list as &$value) {
+            $value['供应商端'] = isset($supp_account[$value['供应商编号']]) ? '已开通' : '未开通';
 //            $value['company_name'] = $company_name[$value['apply_id']] ?? '';
 //            unset($value['apply_id']);
-//
-
-//        }
+        }
 
         if (empty($list)) $list[] = ['没有相关可导出的数据'];
         excelSave('发货工单' . date('YmdHis'), array_keys($list[0]), $list);
@@ -369,7 +375,7 @@ class OrderOutChild extends Base
         //校验是否开通了供应商账号
         $supp_account = checkHasAccountBySupplierNos([$info['supplierNo']]);
 
-        $info['has_account']=(int)isset($supp_account[$info['supplierNo']]);
+        $info['has_account'] = (int)isset($supp_account[$info['supplierNo']]);
         return json_show(0, '获取详情成功', $info);
 
     }

+ 34 - 0
app/admin/route/app.php

@@ -589,6 +589,40 @@ Route::rule('goodCostZhaoExport', 'admin/Report/goodCostZhaoExport');//【商品
 Route::rule('goodPriceZhao', 'admin/Report/goodPriceZhao');//【商品信息】售价(赵丹要的)_列表
 Route::rule('goodPriceZhaoExport', 'admin/Report/goodPriceZhaoExport');//【商品信息】售价(赵丹要的)_导出
 
+Route::rule('r_exportgood', 'admin/ReportByRelaComNo/exportGood');//报表-产品价格和产品
+Route::rule('r_reportzixuntotal', 'admin/ReportByRelaComNo/zixunTotal');//报表-采购日报表-咨询单总数
+Route::rule('r_reportpurcheaseordersum', 'admin/ReportByRelaComNo/purcheaseOrderSum');//报表-采购日报表-采购订单总金额
+Route::rule('r_reportconsultbidssum', 'admin/ReportByRelaComNo/consultBidsSum');//报表-采购日报表-采购员回复咨询单数
+Route::rule('r_reportpurcheaseordersumbyuser', 'admin/ReportByRelaComNo/purcheaseOrderSumByUser');//报表-采购日报表-采购员订单金额
+Route::rule('r_reportconsultinfobidssum', 'admin/ReportByRelaComNo/consultInfoBidsSum');//报表-咨询单报表-已采反报价信息_列表
+Route::rule('r_reportconsultinfobidssumexport', 'admin/ReportByRelaComNo/consultInfoBidsSumExport');//报表-咨询单报表-已采反报价信息_导出
+Route::rule('r_reportconsultinfobidssumnot', 'admin/ReportByRelaComNo/consultInfoBidsSumNot');//报表-咨询单报表-未采反信息_列表
+Route::rule('r_reportconsultinfobidssumnotexport', 'admin/ReportByRelaComNo/consultInfoBidsSumNotExport');//报表-咨询单报表-未采反信息_导出
+Route::rule('r_reportorderlistdetailed', 'admin/ReportByRelaComNo/orderListDetailed');//报表-订单明细报表_列表
+Route::rule('r_reportorderlistdetailedexport', 'admin/ReportByRelaComNo/orderListDetailedExport');//报表-订单明细报表_导出
+Route::rule('r_reportorderreturnlist', 'admin/ReportByRelaComNo/orderReturnList');//报表-售后报表_列表
+Route::rule('r_reportorderreturnlistexport', 'admin/ReportByRelaComNo/orderReturnListExport');//报表-售后报表_导出
+Route::rule('r_reportsupplierlist', 'admin/ReportByRelaComNo/supplierList');//报表-供应商报表_列表
+Route::rule('r_reportsupplierlistexport', 'admin/ReportByRelaComNo/supplierListExport');//报表-供应商报表_导出
+Route::rule('r_reportsalereturnlist', 'admin/ReportByRelaComNo/SaleReturnList');//报表-退货流水报表_列表
+Route::rule('r_reportsalereturnexport', 'admin/ReportByRelaComNo/SaleReturnExport');//报表-退货流水报表_导出
+Route::rule('r_reportgoodonlinelist', 'admin/ReportByRelaComNo/GoodOnlineList');//报表-商品报表-产品上线报表_列表
+Route::rule('r_reportgoodonlineexport', 'admin/ReportByRelaComNo/GoodOnlineExport');//报表-商品报表-产品上线报表_导出
+Route::rule('r_reportgoodofflinelist', 'admin/ReportByRelaComNo/GoodOfflineList');//报表-商品报表-产品下线报表_列表
+Route::rule('r_reportgoodofflineexport', 'admin/ReportByRelaComNo/GoodOfflineExport');//报表-商品报表-产品下线报表_导出
+Route::rule('r_reportchangeloglist', 'admin/ReportByRelaComNo/ChangeLogList');//报表-商品报表-商品修改报表_列表
+Route::rule('r_reportchangelogeexport', 'admin/ReportByRelaComNo/ChangeLogExport');//报表-商品报表-商品修改报表_导出
+Route::rule('r_reportgoodloglist', 'admin/ReportByRelaComNo/GoodLogList');//报表-出入库明细报表_列表
+Route::rule('r_reportgoodlogexport', 'admin/ReportByRelaComNo/GoodLogExport');//报表-出入库明细报表_导出
+Route::rule('r_goodSimpleZhao', 'admin/ReportByRelaComNo/goodSimpleZhao');//【商品信息】基本信息(赵丹要的)_列表
+Route::rule('r_goodSimpleZhaoExport', 'admin/ReportByRelaComNo/goodSimpleZhaoExport');//【商品信息】基本信息(赵丹要的)_导出
+Route::rule('r_goodCostZhao', 'admin/ReportByRelaComNo/goodCostZhao');//【商品信息】成本(赵丹要的)_列表
+Route::rule('r_goodCostZhaoExport', 'admin/ReportByRelaComNo/goodCostZhaoExport');//【商品信息】成本(赵丹要的)_导出
+Route::rule('r_goodPriceZhao', 'admin/ReportByRelaComNo/goodPriceZhao');//【商品信息】售价(赵丹要的)_列表
+Route::rule('r_goodPriceZhaoExport', 'admin/ReportByRelaComNo/goodPriceZhaoExport');//【商品信息】售价(赵丹要的)_导出
+
+
+
 //采购预约报表
 Route::rule("execlist", 'admin/Exec/list');
 Route::rule("execsave", 'admin/Exec/save');